Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5ad7f8ab41
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (17 sloc) 0.579 kb
module Rails
module Generators
class ControllerGenerator < NamedBase # :nodoc:
argument :actions, type: :array, default: [], banner: "action action"
check_class_collision suffix: "Controller"
def create_controller_files
template 'controller.rb', File.join('app/controllers', class_path, "#{file_name}_controller.rb")
end
def add_routes
actions.reverse.each do |action|
route %{get "#{file_name}/#{action}"}
end
end
hook_for :template_engine, :test_framework, :helper, :assets
end
end
end
Jump to Line
Something went wrong with that request. Please try again.