Sha256: d8b76d99b789f2e63f6b9b7f1bc068c3e263b915acb2cf50c09276382dcc63c6

Contents?: true

Size: 414 Bytes

Versions: 9

Compression:

Stored size: 414 Bytes

Contents

require 'action_dispatch/routing/mapper'

module ActionDispatch::Routing::Mapper::Resources
  def resources_with_joosy(*resources, &block)
    resources_without_joosy(*resources, &block).tap do
      namespace = Joosy::Rails::Engine.resources[@scope[:module].to_s] ||= {}
      namespace[resources[0].to_s.singularize] = "#{@scope[:path]}/#{resources[0]}"
    end
  end
  alias_method_chain :resources, :joosy
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
joosy-1.1.2 lib/rails/resources_with_joosy.rb
joosy-1.1.1 lib/rails/resources_with_joosy.rb
joosy-1.1.0 lib/rails/resources_with_joosy.rb
joosy-1.1.0.alpha.3 lib/rails/resources_with_joosy.rb
joosy-1.1.0.alpha.2 lib/rails/resources_with_joosy.rb
joosy-1.1.0.alpha.1 lib/rails/resources_with_joosy.rb
joosy-1.0.0.RC7 lib/rails/resources_with_joosy.rb
joosy-1.0.0.RC6 lib/rails/resources_with_joosy.rb
joosy-1.0.0.RC5 lib/rails/resources_with_joosy.rb