Ruby on rails 使用方法的数据未保存在数据库中
我想使用@reload.status=boolean(true或false),但无法将布尔值保存到数据库中 还有,我一直在做这个,但现在不行了Ruby on rails 使用方法的数据未保存在数据库中,ruby-on-rails,ruby-on-rails-3,Ruby On Rails,Ruby On Rails 3,我想使用@reload.status=boolean(true或false),但无法将布尔值保存到数据库中 还有,我一直在做这个,但现在不行了 def return ret = ActiveMerchant::Billing::Integrations::Ipay88::Notification.new(request.raw_post) if ret.success? @reload = Reload.find(ret.item_id) @reload.st
def return
ret = ActiveMerchant::Billing::Integrations::Ipay88::Notification.new(request.raw_post)
if ret.success?
@reload = Reload.find(ret.item_id)
@reload.status = true
@reload.save
redirect_to new_reload_path, notice: "Success"
else
@reload = Reload.find(ret.item_id)
@reload.status = false
redirect_to new_reload_path, notice: 'Reload unsuccessful'
end
end
我忘了添加@reload.save作为“false”语句。(就像您在“ret.success?”方法调用中看到的那样)