Sha256: 643046aa7e15f799424f61dc3bf26c6226a5be6a2663d30330eeae73502f231f

Contents?: true

Size: 584 Bytes

Versions: 20

Compression:

Stored size: 584 Bytes

Contents

require "rails/generators/resource_helpers"
require "rails/generators/rails/model/model_generator"

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

20 entries across 20 versions & 1 rubygems

Version Path
railties-5.1.7 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.7.rc1 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.6.2 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.6.1 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.6 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.5 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.5.rc1 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.4 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.4.rc1 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.3 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.3.rc3 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.3.rc2 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.3.rc1 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.2 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.2.rc1 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.1 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.0 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.0.rc2 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.0.rc1 lib/rails/generators/rails/resource/resource_generator.rb
railties-5.1.0.beta1 lib/rails/generators/rails/resource/resource_generator.rb