Skip to content
Browse files

Expand select documentation to tell about the block

[ci skip]
  • Loading branch information...
1 parent 0e9f0bd commit 1c6bcefe7e87e1b9c7b2177717bbdc3986806391 @rafaelfranca rafaelfranca committed Sep 23, 2013
Showing with 9 additions and 0 deletions.
  1. +9 −0 actionview/lib/action_view/helpers/form_options_helper.rb
View
9 actionview/lib/action_view/helpers/form_options_helper.rb
@@ -128,6 +128,15 @@ module FormOptionsHelper
# 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

0 comments on commit 1c6bcef

Please sign in to comment.
Something went wrong with that request. Please try again.