Class: ShopifyApp::Generators::HomeControllerGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/shopify_app/home_controller/home_controller_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_home_index_routeObject



24
25
26
# File 'lib/generators/shopify_app/home_controller/home_controller_generator.rb', line 24

def add_home_index_route
  route("root :to => 'home#index'")
end

#create_home_controllerObject



12
13
14
# File 'lib/generators/shopify_app/home_controller/home_controller_generator.rb', line 12

def create_home_controller
  template(home_controller_template, "app/controllers/home_controller.rb")
end

#create_home_index_viewObject



20
21
22
# File 'lib/generators/shopify_app/home_controller/home_controller_generator.rb', line 20

def create_home_index_view
  template("index.html.erb", "app/views/home/index.html.erb")
end

#create_products_controllerObject



16
17
18
# File 'lib/generators/shopify_app/home_controller/home_controller_generator.rb', line 16

def create_products_controller
  generate("shopify_app:products_controller") if embedded? || embedded_app?
end