0

I am trying to post and save the form, which contains data for 2 models, they are connected with associations. But it fails on

Sequel::MassAssignmentRestriction

that the method for column from associated table does not exists. I understand the error and find the answer for rails. Which is to use

accepts_nested_attributes

but I am using Padrino, not rails. So I try nested_parameters but it didn't work and documentation tells just

The nested_attributes call defines a single method, association_attributes=, (e.g. albums_attributes=). So if you have an Artist instance:

which I understand that it is not what I need, for storing all with

@article = Article.new(params[:article])

and associated tables.

Please, do You know how to use it with Padrino and what is right way

Thanks

Mlok
  • 155
  • 9
  • You need to allow Sequel to mass assign values on a model: http://sequel.jeremyevans.net/rdoc/files/doc/mass_assignment_rdoc.html – three Oct 17 '17 at 14:43
  • Thanks a lot! It work! Thank You, I didn't connect it in my mind – Mlok Oct 18 '17 at 05:24
  • Great! Sequel is a very powerful tool and it usually does everything you wioll ever need. – three Oct 18 '17 at 06:40
  • Yes it is, but for me as a beginner is sometimes hard, because its a lots of docs and I start to implement something which is perfectly solved already. But everyday I learn a lots of new things. – Mlok Oct 18 '17 at 07:18

0 Answers0