Answer the question
In order to leave comments, you need to log in
Is there an analogue of strong params inside the model?
Good day,
Actually, the subject is interested in not getting ActiveModel::UnknownAttributeError: unknown attribute .
Modelka:
Actually, you have to do this:Match id: nil, home_team: nil, away_team: nil
hash = {home_team: "Мясо", away_team: "Бомжи", third_team: "Лохомотив"}
Match.create(hash.reject{|t| !Match.attribute_method?(t)})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question