Sha256: 2ab0c3b2408d53909a6f9d06f915c8efbdaff8dab3bf7a52da562f481b8594bd

Contents?: true

Size: 631 Bytes

Versions: 126

Compression:

Stored size: 631 Bytes

Contents

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 # :nodoc:
      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

Version data entries

126 entries across 122 versions & 10 rubygems

Version Path
railties-4.2.11.3 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.2.11.2 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.2.11.1 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.2.11 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.2.10 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.2.10.rc1 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.2.9 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.2.9.rc2 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.2.9.rc1 lib/rails/generators/rails/resource/resource_generator.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/railties-4.2.8/lib/rails/generators/rails/resource/resource_generator.rb
railties-4.2.8 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.2.8.rc1 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.2.7.1 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.2.7 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.1.16 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.1.16.rc1 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.2.7.rc1 lib/rails/generators/rails/resource/resource_generator.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/railties-4.2.6/lib/rails/generators/rails/resource/resource_generator.rb
railties-4.1.15 lib/rails/generators/rails/resource/resource_generator.rb
railties-4.2.6 lib/rails/generators/rails/resource/resource_generator.rb