Skip to content
This repository
tag: v3.2.8.rc1
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 21 lines (16 sloc) 0.654 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
require 'rails/generators/resource_helpers'
require 'rails/generators/rails/model/model_generator'
require 'active_support/core_ext/object/blank'

module Rails
  module Generators
    class ResourceGenerator < ModelGenerator #metagenerator
      include ResourceHelpers

      hook_for :resource_controller, :required => true do |controller|
        invoke controller, [ controller_name, options[:actions] ]
      end

      class_option :actions, :type => :array, :banner => "ACTION ACTION", :default => [],
                             :desc => "Actions for the resource controller"

      hook_for :resource_route, :required => true
    end
  end
end
Something went wrong with that request. Please try again.