Sha256: f29371521026e9f349b75967c556fa46af5a62b4abf820ad8ef25b57194216c6

Contents?: true

Size: 412 Bytes

Versions: 1

Compression:

Stored size: 412 Bytes

Contents

require "resources_id_replace/version"
require 'action_dispatch'

ActionDispatch::Routing::Mapper::Resources::Resource.class_eval do
  def id_replacer
    (@options[:replace_id_with] || 'id').to_s
  end

  def member_scope
    "#{path}/:#{id_replacer}"
  end

  def nested_scope
    "#{path}/:#{singular}_#{id_replacer}"
  end
end
ActionDispatch::Routing::Mapper::Resources::RESOURCE_OPTIONS << :replace_id_with

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
resources_id_replace-0.0.1 lib/resources_id_replace.rb