rails 3 与 rails 4 差异,导致 ActiveModel::ForbiddenAttributesError 的解决方法:
rails3 :
def create
@event = Event.new(params[:event])
end
rails4:
def create
@event = Event.new(event_params)
end
private
def event_params
params.require(:event).permit(:name,:description,:)
end