Sha256: 056c8b7b58d3a51e38fcea474fa0adab034cea59715b3e15706181814738a0db

Contents?: true

Size: 430 Bytes

Versions: 28

Compression:

Stored size: 430 Bytes

Contents

module Rails
  module Generators
    class ResourceRouteGenerator < NamedBase
      def add_resource_route
        return if options[:actions].present?
        route_config =  regular_class_path.collect{ |namespace| "namespace :#{namespace} do " }.join(" ")
        route_config << "resources :#{file_name.pluralize}"
        route_config << " end" * regular_class_path.size
        route route_config
      end
    end
  end
end

Version data entries

28 entries across 22 versions & 5 rubygems

Version Path
challah-0.6.2 vendor/bundle/gems/railties-3.2.6/lib/rails/generators/rails/resource_route/resource_route_generator.rb
initforthe-cookies-0.0.1 vendor/bundle/gems/railties-3.2.6/lib/rails/generators/rails/resource_route/resource_route_generator.rb
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/generators/rails/resource_route/resource_route_generator.rb
railties-3.2.6 lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-0.6.1 vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/resource_route/resource_route_generator.rb
railties-3.2.5 lib/rails/generators/rails/resource_route/resource_route_generator.rb
railties-3.2.4 lib/rails/generators/rails/resource_route/resource_route_generator.rb
railties-3.2.4.rc1 lib/rails/generators/rails/resource_route/resource_route_generator.rb