blob: b9ff225b3d9c7780407a522be0ec9fc3b5d76070 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
class CleanUpsController < ChouetteController
respond_to :html, :only => [:create]
belongs_to :referential
def create
clean_up = CleanUp.new(clean_up_params)
clean_up.referential = @referential
if clean_up.valid?
clean_up.save
else
flash[:alert] = clean_up.errors.full_messages.join("<br/>")
end
redirect_to referential_path(@referential)
end
def clean_up_params
params.require(:clean_up).permit(:date_type, :begin_date, :end_date)
end
end
|