Class: Uicon::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Uicon::InstallGenerator
- Defined in:
- lib/generators/uicon/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#setup_controller ⇒ Object
7 8 9 |
# File 'lib/generators/uicon/install_generator.rb', line 7 def setup_controller generate(:controller, "ui index -q -s --no-helper --no-route --no-helper-specs --no-assets --no-controller-specs --no-view-specs") end |
#setup_route ⇒ Object
11 12 13 |
# File 'lib/generators/uicon/install_generator.rb', line 11 def setup_route route("if Rails.env.development?\n\s\sget 'ui', to: 'ui#index'\n\s\sget '/ui/:action', controller: 'ui'\nend") end |
#setup_view ⇒ Object
15 16 17 18 19 20 |
# File 'lib/generators/uicon/install_generator.rb', line 15 def setup_view File.open("#{Rails.root}/app/views/ui/index.html.erb", 'w') do |f| f.write(view_code) f.close end end |