Sha256: 3c0bf7eaf29bade8f8d3b71ccaeb0bc042f928e600be909c6728783780e358fc

Contents?: true

Size: 827 Bytes

Versions: 62

Compression:

Stored size: 827 Bytes

Contents

require 'rails/generators/base'

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

      def create_home_controller
        template 'home_controller.rb', 'app/controllers/home_controller.rb'
      end

      def create_home_index_view
        copy_file 'index.html.erb', 'app/views/home/index.html.erb'
        if embedded_app?
          prepend_to_file(
            'app/views/home/index.html.erb',
            File.read(File.expand_path(find_in_source_paths('shopify_app_ready_script.html.erb')))
          )
        end
      end

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

      def embedded_app?
        ShopifyApp.configuration.embedded_app?
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
shopify_app-11.7.1 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-11.7.0 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-11.6.0 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-11.5.1 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-11.5.0 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-11.4.0 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-11.3.2 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-11.3.1 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-11.3.0 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-11.2.0 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-11.1.0 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-11.0.2 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-11.0.1 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-11.0.0 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-10.0.0 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-9.0.4 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-9.0.3 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-9.0.2 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-9.0.1 lib/generators/shopify_app/home_controller/home_controller_generator.rb
shopify_app-9.0.0 lib/generators/shopify_app/home_controller/home_controller_generator.rb