Sha256: 4c8ae7a6b9f85eb257da1c492c2dd5c421401b23ffa9e40b3e90c9cc52e4fa2f
Contents?: true
Size: 613 Bytes
Versions: 2
Compression:
Stored size: 613 Bytes
Contents
module Hyrax class ContextualPath include Rails.application.routes.url_helpers include ActionDispatch::Routing::PolymorphicRoutes attr_reader :presenter, :parent_presenter def initialize(presenter, parent_presenter) @presenter = presenter @parent_presenter = parent_presenter end def show if parent_presenter polymorphic_path([:hyrax, :parent, presenter.model_name.singular.to_sym], parent_id: parent_presenter.id, id: presenter.id) else polymorphic_path([presenter]) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hyrax-2.9.6 | app/services/hyrax/contextual_path.rb |
hyrax-2.9.5 | app/services/hyrax/contextual_path.rb |