diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/lookup_context.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/lookup_context.rb b/actionpack/lib/action_view/lookup_context.rb index 06975ffa2f..02114f46da 100644 --- a/actionpack/lib/action_view/lookup_context.rb +++ b/actionpack/lib/action_view/lookup_context.rb @@ -169,10 +169,13 @@ module ActionView # Overload formats= to reject ["*/*"] values. def formats=(values) - if values && values.size == 1 - value = values.first - values = nil if value == "*/*" - values << :html if value == :js + if values + values.pop if values.last == "*/*" + if values.size == 0 + values = nil + elsif values == [:js] + values << :html + end end super(values) end |