aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAlireza Bashiri <azbshiri@gmail.com>2018-07-22 18:27:48 +0430
committerAlireza Bashiri <azbshiri@gmail.com>2018-07-22 18:32:38 +0430
commit905d848b2adce08f4fdd18da96d6a03c3b695095 (patch)
tree5b9c4fe412aa89f6a3135c4f114709a8909b967a /actionpack
parent20543c049625784a91944efdebc1d0c397406f21 (diff)
downloadrails-905d848b2adce08f4fdd18da96d6a03c3b695095.tar.gz
rails-905d848b2adce08f4fdd18da96d6a03c3b695095.tar.bz2
rails-905d848b2adce08f4fdd18da96d6a03c3b695095.zip
Add render options in action_controller/renderer for api documentation [ci skip]
Complete renderer documentation Fixes #28484
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/renderer.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/renderer.rb b/actionpack/lib/action_controller/renderer.rb
index 49c5b782f0..2d1523f0fc 100644
--- a/actionpack/lib/action_controller/renderer.rb
+++ b/actionpack/lib/action_controller/renderer.rb
@@ -71,6 +71,21 @@ module ActionController
end
# Render templates with any options from ActionController::Base#render_to_string.
+ #
+ # The primary options are:
+ # * <tt>:partial</tt> - See <tt>ActionView::PartialRenderer</tt> for details.
+ # * <tt>:file</tt> - Renders an explicit template file. Add <tt>:locals</tt> to pass in, if so desired.
+ # It shouldn’t be used directly with unsanitized user input due to lack of validation.
+ # * <tt>:inline</tt> - Renders a ERB template string.
+ # * <tt>:plain</tt> - Renders provided text and sets the content type as <tt>text/plain</tt>.
+ # * <tt>:html</tt> - Renders the provided HTML safe string, otherwise
+ # performs HTML escape on the string first. Sets the content type as <tt>text/html</tt>.
+ # * <tt>:json</tt> - Renders the provided hash or object in JSON. You don't
+ # need to call <tt>.to_json<tt> on the object you want to render.
+ # * <tt>:body</tt> - Renders provided text and sets content type of <tt>text/plain</tt>.
+ #
+ # If no <tt>options</tt> hash is passed or if <tt>:update</tt> is specified, the default is
+ # to render a partial and use the second parameter as the locals hash.
def render(*args)
raise "missing controller" unless controller