Permalink
Browse files

Add railtie to perform initialization when running under rails3

  • Loading branch information...
1 parent 62443aa commit 8d17ca431c8a60a14399834623ab798dcf0f1b98 @yabawock yabawock committed Apr 11, 2010
Showing with 11 additions and 0 deletions.
  1. +1 −0 lib/formtastic.rb
  2. +10 −0 lib/formtastic/railtie.rb
View
@@ -1,5 +1,6 @@
# coding: utf-8
require File.join(File.dirname(__FILE__), *%w[formtastic i18n])
+require File.join(File.dirname(__FILE__), *%w[formtastic railtie]) if defined?(::Rails::Railtie)
module Formtastic #:nodoc:
@@ -0,0 +1,10 @@
+require 'formtastic'
+require 'rails'
+
+module Formtastic
+ class Railtie < Rails::Railtie
+ initializer :after_initialize do
+ ActionView::Base.send :include, Formtastic::SemanticFormHelper
+ end
+ end
+end

0 comments on commit 8d17ca4

Please sign in to comment.