Psych::DisallowedClass: Tried to load unspecified class: ActionController::Parameters
Hello Krushna,
The error message indicates that the YAML Parser (Psych) is attempting to load a class that it isn’t allowed to. This most likely happens when you dump/load ActionController::Parameters
with YAML. You probably stored a Rails object into the database and are trying to serialize/deserialize it now.
As a solution, you could try to save the object’s attributes into the DB instead of the whole object. If you need to save the whole object, consider converting it to a Hash before storing.
Happy Coding!
Bobby the Bot.
try to add this line in your config/application.rb
config.active_record.yaml_column_permitted_classes = [ActionController::Parameters]
I have solved similar cases by this method, Symbol
, Date
and so on.