From 905d848b2adce08f4fdd18da96d6a03c3b695095 Mon Sep 17 00:00:00 2001 From: Alireza Bashiri Date: Sun, 22 Jul 2018 18:27:48 +0430 Subject: Add render options in action_controller/renderer for api documentation [ci skip] Complete renderer documentation Fixes #28484 --- actionpack/lib/action_controller/renderer.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'actionpack/lib/action_controller') 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: + # * :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 a 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, the default is + # to render a partial and use the second parameter as the locals hash. def render(*args) raise "missing controller" unless controller -- cgit v1.2.3