Browse files

Added some documentation to check_boxes_input() for the :value_method…

… option
  • Loading branch information...
1 parent 7ad5162 commit ed49dade3af52cd7f0e54ad5b6604c11c8a8a7cb @justinfrench justinfrench committed Oct 12, 2009
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/formtastic.rb
View
5 lib/formtastic.rb
@@ -839,6 +839,11 @@ def date_or_datetime_input(method, options)
# You can set :value_as_class => true if you want that LI wrappers contains
# a class with the wrapped checkbox input value.
#
+ # By default, the value attribute of each checkbox tag is the @#id@ of each child object in the
+ # collection, but you can call any other method on the object by passing in a :value_method:
+ #
+ # f.input :author, :as => :check_boxes, :value_method => :login
+ # f.input :tags, :as => :check_boxes, :value_method => :name
def check_boxes_input(method, options)
collection = find_collection_for_column(method, options)
html_options = options.delete(:input_html) || {}

0 comments on commit ed49dad

Please sign in to comment.