Method: ActionView::Base#render_file
- Defined in:
- lib/action_view/base.rb
#render_file(template_path, use_full_path = true, local_assigns = {}) ⇒ Object
Renders the template present at template_path. If use_full_path is set to true, it’s relative to the view_paths array, otherwise it’s absolute. The hash in local_assigns is made available as local variables.
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/action_view/base.rb', line 226 def render_file(template_path, use_full_path = true, local_assigns = {}) #:nodoc: if defined?(ActionMailer) && defined?(ActionMailer::Base) && controller.is_a?(ActionMailer::Base) && !template_path.include?("/") raise ActionViewError, <<-END_ERROR Due to changes in ActionMailer, you need to provide the mailer_name along with the template name. render "user_mailer/signup" render :file => "user_mailer/signup" If you are rendering a subtemplate, you must now use controller-like partial syntax: render :partial => 'signup' # no mailer_name necessary END_ERROR end Template.new(self, template_path, use_full_path, local_assigns).render_template end |