diff options
author | José Valim <jose.valim@gmail.com> | 2012-02-26 22:31:54 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-02-26 22:31:54 -0800 |
commit | 551566db06f54f35aeadaa320ef073ea1335ad60 (patch) | |
tree | e3fb546cb04bd4659d8f82f19ba82817afca7f5e /actionpack/lib | |
parent | 5c0aba238c37a71fce08f949bc2c6bdd9aab4f7b (diff) | |
parent | 2ff884c74888e9133120782b9be14e3ef97f3958 (diff) | |
download | rails-551566db06f54f35aeadaa320ef073ea1335ad60.tar.gz rails-551566db06f54f35aeadaa320ef073ea1335ad60.tar.bz2 rails-551566db06f54f35aeadaa320ef073ea1335ad60.zip |
Merge pull request #5185 from rafaelfranca/fix-collection_helpers
Fix collection helpers
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_options_helper.rb | 12 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/tags/collection_helpers.rb | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index f73ca220fb..5be3da9b94 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -578,9 +578,9 @@ module ActionView # b.label(:class => "radio_button") { b.radio_button(:class => "radio_button") } # end # - # There are also two special methods available: <tt>text</tt> and - # <tt>value</tt>, which are the current text and value methods for the - # item being rendered, respectively. You can use them like this: + # There are also three special methods available: <tt>object</tt>, <tt>text</tt> and + # <tt>value</tt>, which are the current item being rendered, its text and value methods, + # respectively. You can use them like this: # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| # b.label(:"data-value" => b.value) { b.radio_button + b.text } # end @@ -641,9 +641,9 @@ module ActionView # b.label(:class => "check_box") { b.check_box(:class => "check_box") } # end # - # There are also two special methods available: <tt>text</tt> and - # <tt>value</tt>, which are the current text and value methods for the - # item being rendered, respectively. You can use them like this: + # There are also three special methods available: <tt>object</tt>, <tt>text</tt> and + # <tt>value</tt>, which are the current item being rendered, its text and value methods, + # respectively. You can use them like this: # collection_check_boxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| # b.label(:"data-value" => b.value) { b.check_box + b.text } # end diff --git a/actionpack/lib/action_view/helpers/tags/collection_helpers.rb b/actionpack/lib/action_view/helpers/tags/collection_helpers.rb index 6f950e552a..6a1479069f 100644 --- a/actionpack/lib/action_view/helpers/tags/collection_helpers.rb +++ b/actionpack/lib/action_view/helpers/tags/collection_helpers.rb @@ -59,6 +59,7 @@ module ActionView end end + html_options[:object] = @object html_options end |