Sha256: c312f4aaf9ab15184275ae6e40f5a155a1856e80261566db392efac4bf1b837b
Contents?: true
Size: 600 Bytes
Versions: 58
Compression:
Stored size: 600 Bytes
Contents
module Hyrax # A model name that provides routes that are namespaced to Hyrax, # without changing the param key. # # Example: # name = Hyrax::Name.new(MyWork) # name.param_key # # => 'my_work' # name.route_key # # => 'hyrax_my_works' # class Name < ActiveModel::Name def initialize(klass, namespace = nil, name = nil) super @route_key = "hyrax_#{ActiveSupport::Inflector.pluralize(@param_key)}" @singular_route_key = ActiveSupport::Inflector.singularize(@route_key) @route_key << "_index" if @plural == @singular end end end
Version data entries
58 entries across 58 versions & 2 rubygems