Skip to content

Commit 4e78ce6

Browse files
authored
Merge pull request rails#53601 from stevepolitodesign/sp-options-for-render
Document options for `render` in API [ci skip]
2 parents 0be1a60 + 8505a60 commit 4e78ce6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

actionpack/lib/action_controller/metal/rendering.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ def inherited(klass)
160160
# render "posts/new", status: :unprocessable_entity
161161
# # => renders app/views/posts/new.html.erb with HTTP status code 422
162162
#
163+
# `:variants`
164+
# : This tells Rails to look for the first template matching any of the variations.
165+
#
166+
# render "posts/index", variants: [:mobile]
167+
# # => renders app/views/posts/index.html+mobile.erb
168+
#
163169
#--
164170
# Check for double render errors and set the content_type after rendering.
165171
def render(*args)

0 commit comments

Comments
 (0)