class Motorhead::Generators::ControllerGenerator

Public Class Methods

source_paths() click to toggle source
Calls superclass method
# File lib/generators/motorhead/controller_generator.rb, line 12
def source_paths
  [File.expand_path('../templates', __FILE__), *super]
end

Public Instance Methods

create_controller_files() click to toggle source

override

# File lib/generators/motorhead/controller_generator.rb, line 18
def create_controller_files
  @destination_stack[@destination_stack.size - 1] = File.join @destination_stack.last, 'app/engines', class_path
  template 'controller.rb', File.join('app/controllers', class_path, "#{file_name}_controller.rb")
end

Private Instance Methods

generate_routing_code(action) click to toggle source
# File lib/generators/motorhead/controller_generator.rb, line 26
def generate_routing_code(action)
  # https://github.com/rails/rails/commit/d2be2a9166
  "  get '#{file_name}/#{action}'"
end