Class: Bootstrap2FormBuilder::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/bootstrap2_form_builder/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_my_initializerObject

all public methods in here will be run in order



10
11
12
# File 'lib/generators/bootstrap2_form_builder/install_generator.rb', line 10

def add_my_initializer
  template "initializer.rb", "config/initializers/bootstrap2_form_builder.rb"
end

#create_error_partialsObject



14
15
16
17
18
19
20
# File 'lib/generators/bootstrap2_form_builder/install_generator.rb', line 14

def create_error_partials
  if options[:view_engine] == "haml" || options[:haml]
    copy_file "_error_messages.html.haml", "app/views/bootstrap2_form_builder/_error_messages.html.haml"
  elsif
    copy_file "_error_messages.html.erb", "app/views/bootstrap2_form_builder/_error_messages.html.erb"
  end
end