Use AJAX requests to select legislation proposals
Now the interface is more similar to the one in budget investments.
This commit is contained in:
@@ -12,7 +12,5 @@ class Admin::Legislation::ProposalsController < Admin::Legislation::BaseControll
|
||||
def toggle_selection
|
||||
@proposal.toggle :selected
|
||||
@proposal.save!
|
||||
redirect_to admin_legislation_process_proposals_path,
|
||||
notice: t('admin.legislation.proposals.update.notice')
|
||||
end
|
||||
end
|
||||
@@ -19,7 +19,7 @@
|
||||
<td class="text-center"><%= proposal.id %></td>
|
||||
<td><%= proposal.title %></td>
|
||||
<td class="text-center"><%= proposal.cached_votes_up %></td>
|
||||
<td><%= render "select_proposal", proposal: proposal %></td>
|
||||
<td class="select"><%= render "select_proposal", proposal: proposal %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -8,5 +8,6 @@
|
||||
|
||||
<%= link_to button_text,
|
||||
toggle_selection_admin_legislation_process_proposal_path(proposal.process, proposal),
|
||||
remote: true,
|
||||
method: :patch,
|
||||
class: clas %>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
$("#<%= dom_id(@proposal) %> .select").html('<%= j render("select_proposal", proposal: @proposal) %>');
|
||||
Reference in New Issue
Block a user