1class Admin::Archived::PetitionDetailsController < Admin::AdminController |
|
2 before_action :fetch_petition |
|
4 def show |
|
5 end |
|
7 def update |
|
8 if @petition.update_attributes(petition_params) |
|
9 redirect_to admin_archived_petition_url(@petition), notice: :petition_updated |
|
10 else |
|
11 render :show |
|
12 end |
|
13 end |
|
15 private
|
|
17 def fetch_petition |
|
18 @petition = ::Archived::Petition.find(params[:petition_id]) |
|
19 end |
|
21 def petition_attributes |
|
22 %i[action background additional_details special_consideration] |
|
23 end |
|
25 def petition_params |
|
26 params.require(:archived_petition).permit(*petition_attributes) |
|
27 end |
|
28end |