diff --git a/app/helpers/legislation_helper.rb b/app/helpers/legislation_helper.rb index 415de8e74..943f1b35d 100644 --- a/app/helpers/legislation_helper.rb +++ b/app/helpers/legislation_helper.rb @@ -11,22 +11,6 @@ module LegislationHelper t("proposals.index.start_proposal") end - def link_to_toggle_legislation_proposal_selection(proposal) - if proposal.selected? - button_text = t("admin.legislation.proposals.index.selected") - html_class = "button expanded" - else - button_text = t("admin.legislation.proposals.index.select") - html_class = "button hollow expanded" - end - - link_to button_text, - toggle_selection_admin_legislation_process_proposal_path(proposal.process, proposal), - remote: true, - method: :patch, - class: html_class - end - def legislation_process_tabs(process) { "info" => edit_admin_legislation_process_path(process), diff --git a/app/helpers/proposals_helper.rb b/app/helpers/proposals_helper.rb index 3cc0ba03a..9f0b36815 100644 --- a/app/helpers/proposals_helper.rb +++ b/app/helpers/proposals_helper.rb @@ -73,11 +73,14 @@ module ProposalsHelper html_class = "button hollow expanded" end - link_to button_text, - toggle_selection_admin_proposal_path(proposal), - remote: true, - method: :patch, - class: html_class + case proposal.class.to_s + when "Proposal" + path = toggle_selection_admin_proposal_path(proposal) + when "Legislation::Proposal" + path = toggle_selection_admin_legislation_process_proposal_path(proposal.process, proposal) + end + + link_to button_text, path, remote: true, method: :patch, class: html_class end def css_for_proposal_info_row diff --git a/app/views/admin/legislation/proposals/_proposals.html.erb b/app/views/admin/legislation/proposals/_proposals.html.erb index 8682eeab6..a740cbd38 100644 --- a/app/views/admin/legislation/proposals/_proposals.html.erb +++ b/app/views/admin/legislation/proposals/_proposals.html.erb @@ -9,7 +9,7 @@