Class: Decidim::ReportingProposals::EditNoteModalCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::ReportingProposals::EditNoteModalCell
- Includes:
- ActionView::Helpers::FormOptionsHelper
- Defined in:
- app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb
Instance Method Summary collapse
- #modal_id ⇒ Object
- #note ⇒ Object
- #note_body ⇒ Object
- #note_path ⇒ Object
- #notes_form ⇒ Object
- #proposal ⇒ Object
- #show ⇒ Object
Instance Method Details
#modal_id ⇒ Object
24 25 26 |
# File 'app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb', line 24 def modal_id [:modal_id] || "editNoteModal" end |
#note ⇒ Object
12 13 14 |
# File 'app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb', line 12 def note model end |
#note_body ⇒ Object
20 21 22 |
# File 'app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb', line 20 def note_body model.body end |
#note_path ⇒ Object
32 33 34 |
# File 'app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb', line 32 def note_path Decidim::ReportingProposals::AdminEngine.routes.url_helpers.proposal_note_path(proposal_id: proposal.id, id: note) end |
#notes_form ⇒ Object
28 29 30 |
# File 'app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb', line 28 def notes_form @notes_form = Decidim::Proposals::Admin::ProposalNoteForm.from_model(note) end |
#proposal ⇒ Object
16 17 18 |
# File 'app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb', line 16 def proposal Decidim::Proposals::Proposal.find(model.decidim_proposal_id) end |
#show ⇒ Object
8 9 10 |
# File 'app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb', line 8 def show render if note end |