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



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_controllerObject



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 = options['with_session_token']

  template(home_controller_template, 'app/controllers/home_controller.rb')
end

#create_home_index_viewObject



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_controllerObject



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