Method: ActionController::Renderer#render

Defined in:
actionpack/lib/action_controller/renderer.rb

#render(*args) ⇒ Object Also known as: render_to_string

Renders a template to a string, just like ActionController::Rendering#render_to_string.



129
130
131
132
133
134
135
136
137
# File 'actionpack/lib/action_controller/renderer.rb', line 129

def render(*args)
  request = ActionDispatch::Request.new(env_for_request)
  request.routes = controller._routes

  instance = controller.new
  instance.set_request! request
  instance.set_response! controller.make_response!(request)
  instance.render_to_string(*args)
end