render
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (34)
- 6.1.3.1 (4)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (-38)
- 7.1.3.4 (0)
- What's this?
render(*args)
public
Render templates with any options from ActionController::Base#render_to_string.
The primary options are:
-
:partial - See ActionView::PartialRenderer for details.
-
:file - Renders an explicit template file. Add :locals to pass in, if so desired. It shouldnât be used directly with unsanitized user input due to lack of validation.
-
:inline - Renders an ERB template string.
-
:plain - Renders provided text and sets the content type as text/plain.
-
:html - Renders the provided HTML safe string, otherwise performs HTML escape on the string first. Sets the content type as text/html.
-
:json - Renders the provided hash or object in JSON. You don’t need to call .to_json on the object you want to render.
-
:body - Renders provided text and sets content type of text/plain.
If no options hash is passed or if :update is specified, then:
If an object responding to render_in is passed, render_in is called on the object, passing in the current view context.
Otherwise, a partial is rendered using the second parameter as the locals hash.