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-rolls-0.2.0 vendor/bundle/gems/railties-3.2.8/lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-rolls-0.2.0 vendor/bundle/gems/railties-3.2.7/lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/railties-3.2.8/lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/railties-3.2.7/lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-0.8.3 vendor/bundle/gems/railties-3.2.8/lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-0.8.1 vendor/bundle/gems/railties-3.2.8/lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-rolls-0.1.0 vendor/bundle/gems/railties-3.2.8/lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-rolls-0.1.0 vendor/bundle/gems/railties-3.2.7/lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-rolls-0.1.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/railties-3.2.7/lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-0.8.0.pre vendor/bundle/gems/railties-3.2.7/lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-0.7.1 vendor/bundle/gems/railties-3.2.7/lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-0.7.0 vendor/bundle/gems/railties-3.2.7/lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-0.7.0.pre2 vendor/bundle/gems/railties-3.2.7/lib/rails/generators/rails/resource_route/resource_route_generator.rb
railties-3.2.8 lib/rails/generators/rails/resource_route/resource_route_generator.rb
railties-3.2.8.rc2 lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-0.7.0.pre vendor/bundle/gems/railties-3.2.7/lib/rails/generators/rails/resource_route/resource_route_generator.rb
railties-3.2.8.rc1 lib/rails/generators/rails/resource_route/resource_route_generator.rb
railties-3.2.7 lib/rails/generators/rails/resource_route/resource_route_generator.rb
railties-3.2.7.rc1 lib/rails/generators/rails/resource_route/resource_route_generator.rb
challah-0.6.2 vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/resource_route/resource_route_generator.rb