class SimpleForm::Generators::InstallGenerator

Public Instance Methods

copy_config() click to toggle source
# File lib/generators/simple_form/install_generator.rb, line 16
def copy_config
  template "config/initializers/simple_form.rb"

  if options[:bootstrap]
    template "config/initializers/simple_form_bootstrap.rb"
  end

  directory 'config/locales'
end
copy_scaffold_template() click to toggle source
# File lib/generators/simple_form/install_generator.rb, line 26
def copy_scaffold_template
  engine = options[:template_engine]
  copy_file "_form.html.#{engine}", "lib/templates/#{engine}/scaffold/_form.html.#{engine}"
end
info_bootstrap() click to toggle source
# File lib/generators/simple_form/install_generator.rb, line 9
def info_bootstrap
  return if options.bootstrap?
  puts "SimpleForm 2 supports Twitter bootstrap. In case you want to "            "generate bootstrap configuration, please re-run this "            "generator passing --bootstrap as option."
end
show_readme() click to toggle source
# File lib/generators/simple_form/install_generator.rb, line 31
def show_readme
  if behavior == :invoke && options.bootstrap?
    readme "README"
  end
end