Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Modernize examples a bit #810

merged 1 commit into from

4 participants


No description provided.


seems great, @justinfrench ?



@justinfrench justinfrench merged commit 16cf27c into justinfrench:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 24, 2012
  1. @denispeplin
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 README.textile
6 README.textile
@@ -317,14 +317,14 @@ Customize the default class used for hints on each attribute or globally in the
Many inputs provide a collection of options to choose from (like @:select@, @:radio@, @:check_boxes@, @:boolean@). In many cases, Formtastic can find choices through the model associations, but if you want to use your own set of choices, the @:collection@ option is what you want. You can pass in an Array of objects, an array of Strings, a Hash... Throw almost anything at it! Examples:
- f.input :authors, :as => :check_boxes, :collection => User.find(:all, :order => "last_name ASC")
+ f.input :authors, :as => :check_boxes, :collection => User.order("last_name ASC").all
f.input :authors, :as => :check_boxes, :collection =>
f.input :authors, :as => :check_boxes, :collection => [@justin, @kate]
f.input :authors, :as => :check_boxes, :collection => ["Justin", "Kate", "Amelia", "Gus", "Meg"]
- f.input :author, :as => :select, :collection => Author.find(:all)
+ f.input :author, :as => :select, :collection => Author.all
f.input :author, :as => :select, :collection => { =>, => }
f.input :author, :as => :select, :collection => ["Justin", "Kate", "Amelia", "Gus", "Meg"]
- f.input :author, :as => :radio, :collection => User.find(:all)
+ f.input :author, :as => :radio, :collection => User.all
f.input :author, :as => :radio, :collection => [@justin, @kate]
f.input :author, :as => :radio, :collection => { =>, => }
f.input :author, :as => :radio, :collection => ["Justin", "Kate", "Amelia", "Gus", "Meg"]
Something went wrong with that request. Please try again.