1class Admin::Archived::PetitionTagsController < Admin::AdminController |
|
2 before_action :fetch_petition |
|
4 def show |
|
5 render 'admin/archived/petitions/show' |
|
6 end |
|
8 def update |
|
9 if @petition.update(petition_params) |
|
10 redirect_to admin_archived_petition_url(@petition), notice: :petition_updated |
|
11 else |
|
12 render 'admin/archived/petitions/show' |
|
13 end |
|
14 end |
|
16 private
|
|
18 def fetch_petition |
|
19 @petition = ::Archived::Petition.find(params[:petition_id]) |
|
20 end |
|
22 def petition_params |
|
23 params.require(:petition).permit(tags: []) |
|
24 end |
|
25end |