Class: SimpleForm::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- SimpleForm::Generators::InstallGenerator
- Defined in:
- lib/generators/simple_form/install_generator.rb
Instance Method Summary collapse
- #copy_config ⇒ Object
- #copy_scaffold_template ⇒ Object
- #info_bootstrap ⇒ Object
- #show_readme ⇒ Object
Instance Method Details
#copy_config ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/generators/simple_form/install_generator.rb', line 17 def copy_config template "config/initializers/simple_form.rb" if [:bootstrap] template "config/initializers/simple_form_bootstrap.rb" elsif [:foundation] template "config/initializers/simple_form_foundation.rb" end directory 'config/locales' end |
#copy_scaffold_template ⇒ Object
29 30 31 32 |
# File 'lib/generators/simple_form/install_generator.rb', line 29 def copy_scaffold_template engine = [:template_engine] copy_file "_form.html.#{engine}", "lib/templates/#{engine}/scaffold/_form.html.#{engine}" end |
#info_bootstrap ⇒ Object
10 11 12 13 14 15 |
# File 'lib/generators/simple_form/install_generator.rb', line 10 def info_bootstrap return if .bootstrap? || .foundation? puts "SimpleForm 2 supports Twitter 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 ⇒ Object
34 35 36 37 38 |
# File 'lib/generators/simple_form/install_generator.rb', line 34 def show_readme if behavior == :invoke && .bootstrap? readme "README" end end |