diff options
author | Łukasz Strzałkowski <lukasz.strzalkowski@gmail.com> | 2013-07-12 13:01:10 +0200 |
---|---|---|
committer | Łukasz Strzałkowski <lukasz.strzalkowski@gmail.com> | 2013-08-25 11:39:09 +0200 |
commit | d6363aa1805bed920e404035aae7138421902d5d (patch) | |
tree | 8812290a9bd140e3ecb9120af5157eec940d69e4 /actionview | |
parent | fae8f72076c7feef271176636aef9e2dca3930fe (diff) | |
download | rails-d6363aa1805bed920e404035aae7138421902d5d.tar.gz rails-d6363aa1805bed920e404035aae7138421902d5d.tar.bz2 rails-d6363aa1805bed920e404035aae7138421902d5d.zip |
Code formatting & typo fixes
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/lib/action_view/rendering.rb | 70 |
1 files changed, 35 insertions, 35 deletions
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 |