class SimpleForm::Generators::InstallGenerator
Public Instance Methods
copy_config()
click to toggle source
# File lib/generators/simple_form/install_generator.rb, line 17 def copy_config template "config/initializers/simple_form.rb" if options[:bootstrap] template "config/initializers/simple_form_bootstrap.rb" elsif options[:foundation] template "config/initializers/simple_form_foundation.rb" end directory 'config/locales' end
copy_scaffold_template()
click to toggle source
# File lib/generators/simple_form/install_generator.rb, line 29 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 10 def info_bootstrap return if options.bootstrap? || options.foundation? puts "SimpleForm 2 supports Bootstrap and Zurb Foundation 3. If you want " "a configuration that is compatible with one of these frameworks, then please " "re-run this generator with --bootstrap or --foundation as an option." end
show_readme()
click to toggle source
# File lib/generators/simple_form/install_generator.rb, line 34 def show_readme if behavior == :invoke && options.bootstrap? readme "README" end end