Class: Shopifydev::ProductUiGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/rails/generators/shopifydev/product_ui_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_inline_error_helperObject



18
19
20
# File 'lib/rails/generators/shopifydev/product_ui_generator.rb', line 18

def add_inline_error_helper
  template "helpers/inline_error_helper.rb", "app/helpers/inline_error_helper.rb" 
end

#generate_controllerObject



14
15
16
# File 'lib/rails/generators/shopifydev/product_ui_generator.rb', line 14

def generate_controller
  template "controllers/product_caches_controller.rb", "app/controllers/product_caches_controller.rb"
end

#generate_viewsObject



8
9
10
11
12
# File 'lib/rails/generators/shopifydev/product_ui_generator.rb', line 8

def generate_views
  template "views/product_caches/_app_fields_header.html.slim", "app/views/product_caches/_app_fields_header.html.slim"
  template "views/product_caches/_app_fields.html.slim", "app/views/product_caches/_app_fields.html.slim"
  template "views/product_caches/index.html.slim", "app/views/product_caches/index.html.slim"
end

#routesObject



22
23
24
25
26
27
28
29
30
31
# File 'lib/rails/generators/shopifydev/product_ui_generator.rb', line 22

def routes
  route %Q{
  resources :product_caches, only: [:index] do
collection do
  get 'page/:page', action: :index
  put 'update_multiple'
end
  end
}
end