Browse files

Merge pull request #818 from ZachBeta/master

Added a custom hash to the collections section of the readme
  • Loading branch information...
2 parents c919c2f + f9e7ecd commit 0f42a5ce74f4f980ad35353079c1de96bfee853b @justinfrench justinfrench committed Mar 3, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 README.textile
View
1 README.textile
@@ -329,6 +329,7 @@ Many inputs provide a collection of options to choose from (like @:select@, @:ra
f.input :author, :as => :radio, :collection => { @justin.name => @justin.id, @kate.name => @kate.id }
f.input :author, :as => :radio, :collection => ["Justin", "Kate", "Amelia", "Gus", "Meg"]
f.input :admin, :as => :radio, :collection => ["Yes!", "No"]
+ f.input :book_id, :as => :select, :collection => Hash[Book.all.map{|b| [b.name,b.id]}]
</pre>

0 comments on commit 0f42a5c

Please sign in to comment.