This is a two step process.
First you need a means of selecting only People that are active. Next you need to pass that collection of active people to the formtastic input via the :collection option.
Step one selecting only active people: This is as simple as Person.find(:all, :conditions ["active = ?", true])
. But I think this is better accomplished with a named scope in the model.
class Person < ActiveRecord::Base
# ...
named_scope :active, :conditions => {:active => true}
end
Now Person.active
is the same as Person.find(:all, :conditions ["active = ?", true])
Step two, updating the form:
- semantic_form_for @member do |f|
- f.inputs do
= f.input :person, :collection => Person.active
= f.input :role, :include_blank => false
= f.input :active