gem 'twitter-bootstrap-rails', :git => 'https://github.com/jonochang/twitter-bootstrap-rails.git' # TODO only in :group => :assets # TODO if jruby, then use static assets if config['use_simple_form'] after_everything do gsub_file "config/initializers/simple_form.rb", '# config.label_text = lambda { |label, required| "#{required} #{label}" }', 'config.label_text = lambda { |label, required| "#{label} #{required}" }' original_wrapper = <<-RB config.wrappers :class => :input, :error_class => :field_with_errors do |b| b.use :placeholder b.use :label_input b.use :hint, :tag => :span, :class => :hint b.use :error, :tag => :span, :class => :error end RB new_wrapper = <<-RB config.wrappers :inline, :class => 'clearfix', :error_class => :error do |b| b.use :placeholder b.use :label b.use :tag => 'div', :class => 'input' do |ba| ba.use :input ba.use :error, :tag => :span, :class => :'help-inline' ba.use :hint, :tag => :span, :class => :'help-block' end end config.wrappers :stacked, :class => "clearfix", :error_class => :error do |b| b.use :placeholder b.use :label b.use :hint, :tag => :span, :class => :'help-block' b.use :tag => 'div', :class => 'input' do |input| input.use :input input.use :error, :tag => :span, :class => :'help-inline' end end RB gsub_file "config/initializers/simple_form.rb", original_wrapper, new_wrapper gsub_file "config/initializers/simple_form.rb", "# config.button_class = 'button'", "config.button_class = 'btn'" application_layout_body = <<-ERB
<%= yield %> ERB application_layout_body_new = <<-ERB