diff options
-rw-r--r-- | actionpack/lib/abstract_controller/rendering.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/base.rb | 2 | ||||
-rw-r--r-- | actionview/lib/action_view/rendering.rb | 70 |
3 files changed, 37 insertions, 37 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index bdecc37063..6bfe0a361f 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -11,7 +11,7 @@ module AbstractController end module Rendering - extend ActiveSupport::Concern + extend ActiveSupport::Concern included do class_attribute :protected_instance_variables diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index b785d52832..80b5f118ff 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -4,7 +4,7 @@ require "action_controller/metal/params_wrapper" module ActionController # The <tt>metal</tt> anonymous class is simple workaround the ordering issues there are with modules. - # They need to be included in specyfic order which makes it impossible for 3rd party libs (like ActiveRecord) + # They need to be included in specific order which makes it impossible for 3rd party libs (like ActiveRecord) # to hook up with its own functionality. Having anonymous super class type of Metal with <tt>AbstractController::Rendering</tt> # included, allows us to include <tt>ActionView::Rendering</tt> (which implements <tt>AbstractController::Rendering</tt> interface) # after the <tt>AbstractController::Rendering</tt> and before <tt>ActionController::Rendering</tt>. diff --git a/actionview/lib/action_view/rendering.rb b/actionview/lib/action_view/rendering.rb index f4afb63d5f..0ec0c0f0d3 100644 --- a/actionview/lib/action_view/rendering.rb +++ b/actionview/lib/action_view/rendering.rb @@ -114,46 +114,46 @@ module ActionView private - # Normalize args and options. - # :api: private - def _normalize_render(*args, &block) - options = _normalize_args(*args, &block) - _normalize_options(options) - options - end - - # Normalize args by converting render "foo" to render :action => "foo" and - # render "foo/bar" to render :file => "foo/bar". - def _normalize_args(action=nil, options={}) - options = super(action, options) - case action - when NilClass - when Hash - options = action - when String, Symbol - action = action.to_s - key = action.include?(?/) ? :file : :action - options[key] = action - else - options[:partial] = action + # Normalize args and options. + # :api: private + def _normalize_render(*args, &block) + options = _normalize_args(*args, &block) + _normalize_options(options) + options end - options - end + # Normalize args by converting render "foo" to render :action => "foo" and + # render "foo/bar" to render :file => "foo/bar". + def _normalize_args(action=nil, options={}) + options = super(action, options) + case action + when NilClass + when Hash + options = action + when String, Symbol + action = action.to_s + key = action.include?(?/) ? :file : :action + options[key] = action + else + options[:partial] = action + end - # Normalize options. - def _normalize_options(options) - options = super(options) - if options[:partial] == true - options[:partial] = action_name + options end - if (options.keys & [:partial, :file, :template]).empty? - options[:prefixes] ||= _prefixes - end + # Normalize options. + def _normalize_options(options) + options = super(options) + if options[:partial] == true + options[:partial] = action_name + end - options[:template] ||= (options[:action] || action_name).to_s - options - end + if (options.keys & [:partial, :file, :template]).empty? + options[:prefixes] ||= _prefixes + end + + options[:template] ||= (options[:action] || action_name).to_s + options + end end end |