Sha256: ac956534d69357ab216404d8fbb8752eab6fee159c6b828d837f3de3490eaf6c

Contents?: true

Size: 750 Bytes

Versions: 24

Compression:

Stored size: 750 Bytes

Contents

# frozen_string_literal: true

require "rails/generators/base"

module ShopifyApp
  module Generators
    class AppProxyControllerGenerator < Rails::Generators::Base
      source_root File.expand_path("../templates", __FILE__)

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

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

      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
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
shopify_app-22.5.1 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-22.5.0 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-22.4.0 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-22.3.1 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-22.3.0 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-22.2.1 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-22.2.0 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-22.1.0 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-22.0.1 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-22.00.0 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-21.10.0 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-21.9.0 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-21.8.1 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-21.8.0 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-21.7.0 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-21.6.0 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-21.5.0 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-21.4.1 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-21.4.0 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
shopify_app-21.3.1 lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb