Class: ShopifyApp::Generators::AppProxyControllerGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_app_proxy_routeObject



18
19
20
21
22
23
24
# File 'lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb', line 18

def add_app_proxy_route
  inject_into_file(
    "config/routes.rb",
    File.read(File.expand_path(find_in_source_paths("app_proxy_route.rb"))),
    after: "mount ShopifyApp::Engine, at: '/'\n",
  )
end

#create_app_proxy_controllerObject



10
11
12
# File 'lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb', line 10

def create_app_proxy_controller
  template("app_proxy_controller.rb", "app/controllers/app_proxy_controller.rb")
end

#create_app_proxy_index_viewObject



14
15
16
# File 'lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb', line 14

def create_app_proxy_index_view
  copy_file("index.html.erb", "app/views/app_proxy/index.html.erb")
end