Class: Decidim::Proposals::VersionsController
- Inherits:
-
ApplicationController
- Object
- Components::BaseController
- ApplicationController
- Decidim::Proposals::VersionsController
- Includes:
- ApplicationHelper, ResourceVersionsConcern
- Defined in:
- app/controllers/decidim/proposals/versions_controller.rb
Overview
Exposes Proposals versions so users can see how a Proposal has been updated through time.
Instance Method Summary collapse
Methods inherited from ApplicationController
#proposal_limit, #proposal_limit_reached?, #proposals
Instance Method Details
#add_breadcrumb_item ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/decidim/proposals/versions_controller.rb', line 14 def return {} if versioned_resource.blank? { label: translated_attribute(versioned_resource.title), url: Decidim::EngineRouter.main_proxy(current_component).proposal_path(versioned_resource), active: false } end |
#versioned_resource ⇒ Object
10 11 12 |
# File 'app/controllers/decidim/proposals/versions_controller.rb', line 10 def versioned_resource @versioned_resource ||= Proposal.not_hidden.published.where(component: current_component).find(params[:proposal_id]) end |