Class: Bootstrap3FormBuilder::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/bootstrap3_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/bootstrap3_form_builder/install_generator.rb', line 10

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

#create_error_partialsObject



14
15
16
17
18
19
20
# File 'lib/generators/bootstrap3_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/bootstrap3_form_builder/_error_messages.html.haml"
  elsif
    copy_file "_error_messages.html.erb", "app/views/bootstrap3_form_builder/_error_messages.html.erb"
  end
end