我的任务是访问参数值以创建新用户。我的创建控制器代码是
def newstudent
@student = Student.new(params)
puts "+++++++++++"
puts params.inspect
if @student.save
respond_to do |format|
format.html # new.html.erb
format.json { render :json => @jtable }
end
end
end
但是通过这样做,我在终端中遇到了一些错误。它显示如下
ActiveModel::MassAssignmentSecurity::Error (Can't mass-assign protected attributes: action, controller):
app/controllers/students_controller.rb:42:in `new'
app/controllers/students_controller.rb:42:in `newstudent'
请帮我解决问题?