你好我得到这个错误不知道如何去做,因为这是第一次体验。
我正在更新数据库行,然后在成功后重定向,并在redirect_to your_reservations_path, flash: "You have submitted your Completed Writing Document"
我的控制器预约:
def update
if @reservation.update(reservation_params)
puts 'first'
if reservation_params.has_key?(:completed_doc)
puts 'second'
@reservation.update_attributes turned_in: true
redirect_to your_reservations_path, flash: "You have submitted your Completed Writing Document"
else
redirect_to your_reservations_path, alert: "Oops, something went wrong..."
end
else
render '_edit'
end
end
答案 0 :(得分:2)
尝试将其更改为:notice
redirect_to your_reservations_path,
notice: "You have submitted your Completed Writing Document"