Skip to content
Browse files

adding documentation for f.association

Example of how to use :label_method and :value_method with f.association

closes #662
  • Loading branch information...
1 parent ce8e96d commit ff5437d6f48c69f3247c1e76b6e855ac16474789 @dinnouti dinnouti committed with nashby Sep 17, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 README.md
View
6 README.md
@@ -318,6 +318,12 @@ the collection by hand, all together with the prompt:
f.association :company, :collection => Company.active.all(:order => 'name'), :prompt => "Choose a Company"
```
+In case you want to declare different labels and values:
+
+```ruby
+f.association :company, :label_method => :company_name, :value_method => :id, :include_blank => false %>
+```
+
### Buttons
All web forms need buttons, right? **SimpleForm** wraps them in the DSL, acting like a proxy:

0 comments on commit ff5437d

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