Sha256: 11f2af3a30b86d661c772da587c4a4f12199a0c64601b7e946e09e13691ef9d1
Contents?: true
Size: 579 Bytes
Versions: 32
Compression:
Stored size: 579 Bytes
Contents
module CurationConcerns 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([:curation_concerns, :parent, presenter.model_name.singular], parent_id: parent_presenter.id, id: presenter.id) else polymorphic_path([presenter]) end end end end
Version data entries
32 entries across 32 versions & 1 rubygems