On branch strong-params
Your branch is behind 'origin/strong-params' by 1 commit, and can be fast-forwarded. I'll pull to catch up after this commit Change code to whitelist params Remove attr_accessible lines Add strong_params to Gemfile, since this branch is still on Rails 3 Mixin to ActiveRecord::Base ActiveModel::ForbiddenAttributesProtection Use an initializer for the mixin
This commit is contained in:
@@ -4,7 +4,7 @@ class ScheduleController < ApplicationController
|
||||
message = false
|
||||
|
||||
if params[:schedule][:event_type] == "pto"
|
||||
sched = Schedule.new(params[:schedule])
|
||||
sched = Schedule.new(schedule_params)
|
||||
sched.date_begin, sched.date_end = format_schedule_date(params[:date_range1])
|
||||
sched.user_id = current_user.user_id
|
||||
a = sched.date_end
|
||||
@@ -56,4 +56,10 @@ class ScheduleController < ApplicationController
|
||||
end
|
||||
return vals
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def schedule_params
|
||||
params.require(:schedule).permit(:date_begin, :date_end, :event_desc, :event_name, :event_type)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user