aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorLukasz Strzalkowski <lukaszstrzalkowski@squareup.com>2014-02-13 15:59:09 +0100
committerLukasz Strzalkowski <lukaszstrzalkowski@squareup.com>2014-02-13 16:22:56 +0100
commitf9b6b865e60ea770cc34e9946f6df1604f20dd27 (patch)
tree552d0ab1ade45463bf5acdfe53a7ac6944806cbe /actionview
parentde5ef153984f4fc3229a3346a8a4a1595303afc8 (diff)
downloadrails-f9b6b865e60ea770cc34e9946f6df1604f20dd27.tar.gz
rails-f9b6b865e60ea770cc34e9946f6df1604f20dd27.tar.bz2
rails-f9b6b865e60ea770cc34e9946f6df1604f20dd27.zip
Variant negotiation
Allow setting `request.variant` as an array - an order in which they will be rendered. For example: request.variant = [:tablet, :phone] respond_to do |format| format.html.none format.html.phone # this gets rendered end
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/rendering.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/rendering.rb b/actionview/lib/action_view/rendering.rb
index 99b95fdfb7..7c17220d14 100644
--- a/actionview/lib/action_view/rendering.rb
+++ b/actionview/lib/action_view/rendering.rb
@@ -94,7 +94,7 @@ module ActionView
variant = options[:variant]
lookup_context.rendered_format = nil if options[:formats]
- lookup_context.variants = [variant] if variant
+ lookup_context.variants = variant if variant
view_renderer.render(view_context, options)
end