Sha256: 468e03c874e4c5b903bfc8acbb21d3fd4da3719f6c649ed555c08692679863ec
Contents?: true
Size: 860 Bytes
Versions: 14
Compression:
Stored size: 860 Bytes
Contents
require 'rails/generators/rails/controller/controller_generator' module Motorhead module Generators class ControllerGenerator < ::Rails::Generators::ControllerGenerator source_root ::Rails::Generators::ControllerGenerator.source_root remove_hook_for :template_engine, :test_framework class << self def source_paths [File.expand_path('../templates', __FILE__), *super] end end # override 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 # override private def generate_routing_code(action) "get '#{file_name}/#{action}'" end end end end
Version data entries
14 entries across 14 versions & 1 rubygems