blob: c25df1a00701b92b19795570d644539e7072c41e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
class CleanUpsController < ChouetteController
include ReferentialSupport
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
|