From 307418c1de0c48e18c07726bdfe8875b28e98cf1 Mon Sep 17 00:00:00 2001 From: Peter Brown Date: Mon, 4 Oct 2010 00:45:19 -0400 Subject: [PATCH] Updated README with Formtastic helper note --- README.textile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.textile b/README.textile index ee049db..0b6492f 100644 --- a/README.textile +++ b/README.textile @@ -99,6 +99,16 @@ With this setup, I can now do the following: @alarm.email? => true +h2. Formtastic Support + +To add ClassyEnum support to Formtastic, add the following to your formtastic.rb initializer (config/initializers/formtastic.rb): + +
+Formtastic::SemanticFormHelper.builder = ClassyEnumHelper::SemanticFormBuilder
+
+ +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@.