Skip to content

Commit

Permalink
Updated README with Formtastic helper note
Browse files Browse the repository at this point in the history
  • Loading branch information
beerlington committed Oct 4, 2010
1 parent 6f57c40 commit 307418c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.textile
Expand Up @@ -99,6 +99,16 @@ With this setup, I can now do the following:
@alarm.email? => true
</pre>

h2. Formtastic Support

To add ClassyEnum support to Formtastic, add the following to your formtastic.rb initializer (config/initializers/formtastic.rb):

<pre>
Formtastic::SemanticFormHelper.builder = ClassyEnumHelper::SemanticFormBuilder
</pre>

Then in your Formtastic view forms, use this syntax: @<%= f.input :priority, :as => :enum_select %>@

h2. Notes

An ActiveRecord validator @validates_inclusion_of :field, :in => ENUM.all@ is automatically added to your model when you use @classy_enum_attr@.
Expand Down

0 comments on commit 307418c

Please sign in to comment.