1class Admin::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, @petition], notice: :petition_updated |
|
10 else |
|
11 render :show |
|
12 end |
|
13 end |
|
15 private
|
|
17 def fetch_petition |
|
18 @petition = Petition.find(params[:petition_id]) |
|
19 end |
|
21 def petition_params |
|
22 params.require(:petition).permit( |
|
23 :action, :background, :additional_details, |
|
24 :special_consideration, :creator_attributes => [:name] |
|
25 )
|
|
26 end |
|
27end |