diff options
author | Xavier Noria <fxn@hashref.com> | 2012-04-07 15:03:27 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2012-04-07 15:03:27 -0700 |
commit | af422bf3c51731320a954ff7c00e0374cfa0eb6c (patch) | |
tree | 37e0262626631d7d553cf56e177bec02f1620b43 /actionpack/lib | |
parent | 4b685aad7b5edeb087968c42f815be2bec14b822 (diff) | |
parent | fd3f550c949fda5d3f9d008bf90091dc151d006f (diff) | |
download | rails-af422bf3c51731320a954ff7c00e0374cfa0eb6c.tar.gz rails-af422bf3c51731320a954ff7c00e0374cfa0eb6c.tar.bz2 rails-af422bf3c51731320a954ff7c00e0374cfa0eb6c.zip |
Merge pull request #5772 from lest/patch-4
use extract_options! in cycle helper
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/text_helper.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index 3dc651501e..eb806f44cf 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -1,5 +1,6 @@ require 'active_support/core_ext/object/blank' require 'active_support/core_ext/string/filters' +require 'active_support/core_ext/array/extract_options' module ActionView # = Action View Text Helpers @@ -306,12 +307,9 @@ module ActionView # </tr> # <% end %> def cycle(first_value, *values) - if (values.last.instance_of? Hash) - params = values.pop - name = params[:name] - else - name = "default" - end + options = values.extract_options! + name = options.fetch(:name, "default") + values.unshift(first_value) cycle = get_cycle(name) |