replace direct_to_template with render