Class: ShopifyApp::Generators::HomeControllerGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ShopifyApp::Generators::HomeControllerGenerator
- Defined in:
- lib/generators/shopify_app/home_controller/home_controller_generator.rb
Instance Method Summary collapse
- #add_home_index_route ⇒ Object
- #create_home_controller ⇒ Object
- #create_home_index_view ⇒ Object
- #create_products_controller ⇒ Object
Instance Method Details
#add_home_index_route ⇒ Object
25 26 27 |
# File 'lib/generators/shopify_app/home_controller/home_controller_generator.rb', line 25 def add_home_index_route route("root :to => 'home#index'") end |
#create_home_controller ⇒ Object
11 12 13 14 15 |
# File 'lib/generators/shopify_app/home_controller/home_controller_generator.rb', line 11 def create_home_controller @with_session_token = ['with_session_token'] template(home_controller_template, 'app/controllers/home_controller.rb') end |
#create_home_index_view ⇒ Object
21 22 23 |
# File 'lib/generators/shopify_app/home_controller/home_controller_generator.rb', line 21 def create_home_index_view template('index.html.erb', 'app/views/home/index.html.erb') end |
#create_products_controller ⇒ Object
17 18 19 |
# File 'lib/generators/shopify_app/home_controller/home_controller_generator.rb', line 17 def create_products_controller generate("shopify_app:products_controller") if with_session_token? end |