Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improve collection radio/check box docs

  • Loading branch information...
commit e911a57322deee6279b5432bad3817f3df00d73b 1 parent 9f69406
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/simple_form/action_view_extensions/builder.rb
View
12 lib/simple_form/action_view_extensions/builder.rb
@@ -7,7 +7,9 @@ module Builder
# Create a collection of radio inputs for the attribute. Basically this
# helper will create a radio input associated with a label for each
# text/value option in the collection, using value_method and text_method
- # to convert these text/value. Based on collection_select.
+ # to convert these text/value. You can give a symbol or a proc to both
+ # value_method and text_method, that will be evaluated for each item in
+ # the collection.
#
# == Examples
#
@@ -42,9 +44,11 @@ def collection_radio(attribute, collection, value_method, text_method, options={
end
end
- # Creates a collection of check boxes for each item in the collection, associated
- # with a clickable label. Use value_method and text_method to convert items in
- # the collection for use as text/value in check boxes.
+ # Creates a collection of check boxes for each item in the collection,
+ # associated with a clickable label. Use value_method and text_method to
+ # convert items in the collection for use as text/value in check boxes.
+ # You can give a symbol or a proc to both value_method and text_method,
+ # that will be evaluated for each item in the collection.
#
# == Examples
#
Please sign in to comment.
Something went wrong with that request. Please try again.