diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-09-23 11:19:35 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-09-23 11:19:35 -0300 |
commit | 1c6bcefe7e87e1b9c7b2177717bbdc3986806391 (patch) | |
tree | 4940ef95c8e926d02b515b0c2d5d379fc1c50379 /actionview/lib/action_view | |
parent | 0e9f0bd6f710e510496fafc402f5a74a03a502fd (diff) | |
download | rails-1c6bcefe7e87e1b9c7b2177717bbdc3986806391.tar.gz rails-1c6bcefe7e87e1b9c7b2177717bbdc3986806391.tar.bz2 rails-1c6bcefe7e87e1b9c7b2177717bbdc3986806391.zip |
Expand select documentation to tell about the block
[ci skip]
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/form_options_helper.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionview/lib/action_view/helpers/form_options_helper.rb b/actionview/lib/action_view/helpers/form_options_helper.rb index d9ccca8880..4347983bad 100644 --- a/actionview/lib/action_view/helpers/form_options_helper.rb +++ b/actionview/lib/action_view/helpers/form_options_helper.rb @@ -128,6 +128,15 @@ module ActionView # or <tt>selected: nil</tt> to leave all options unselected. Similarly, you can specify values to be disabled in the option # tags by specifying the <tt>:disabled</tt> option. This can either be a single value or an array of values to be disabled. # + # A block can be passed to +select+ to customize how the options tags will be rendered. This + # is useful when the options tag has complex attributes. + # + # select(report, "campaign_ids") do + # available_campaigns.each do |c| + # content_tag(:option, c.name, value: c.id, data: { tags: c.tags.to_json }) + # end + # end + # # ==== Gotcha # # The HTML specification says when +multiple+ parameter passed to select and all options got deselected |