Sha256: 57b980840c101988064623e777eaeea7dbe7305373372ff435d4922369bbcf67
Contents?: true
Size: 643 Bytes
Versions: 1
Compression:
Stored size: 643 Bytes
Contents
# frozen_string_literal: true 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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hyrax-3.0.2 | app/services/hyrax/contextual_path.rb |