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