new_order = Order.new(…)
@user.orders << new_order
There are validations for Order model.
How can I judge whether new_order is successfully added into
@user.orders,
and if adding fails, how can I read the validation error messages?
new_order = Order.new(…)
@user.orders << new_order
There are validations for Order model.
How can I judge whether new_order is successfully added into
@user.orders,
and if adding fails, how can I read the validation error messages?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs