diff options
Diffstat (limited to 'actionpack/lib/action_controller/metal/compatibility.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/compatibility.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/metal/compatibility.rb b/actionpack/lib/action_controller/metal/compatibility.rb index 0cb20b2f0f..5cad0814ca 100644 --- a/actionpack/lib/action_controller/metal/compatibility.rb +++ b/actionpack/lib/action_controller/metal/compatibility.rb @@ -49,14 +49,19 @@ module ActionController super end - def render_to_body(options) - if options.is_a?(Hash) && options.key?(:template) - options[:template].sub!(/^\//, '') + def _normalize_options(options) + # TODO Deprecate this. Rails 2.x allowed to give a template as action. + if options[:action] && options[:action].to_s.include?(?/) + options[:template] = options.delete(:action) end options[:text] = nil if options.delete(:nothing) == true options[:text] = " " if options.key?(:text) && options[:text].nil? + super + end + def render_to_body(options) + options[:template].sub!(/^\//, '') if options.key?(:template) super || " " end |