ActiveModel::ForbiddenAttributesError: inherited_resources doesn't call permitted_params
-
19-10-2022 - |
Pregunta
I have a Rails 4.0.2 application which relies on nested_resources. Sadly, I'm getting an ActiveModel::ForbiddenAttributesError
when submitting my form (#create
). My controller looks like the following:
class VocabulariesController < InheritedResources::Base
def permitted_params
params.permit(vocabulary: [:user_id, :name, :lang1, :lang2])
end
end
I placed a binding.pry
in permitted_params
which is never caught, so the method is never actually called by inherited_resources.
Any idea what's wrong here?
Update
It seems that I didn't have the current version, although I did a bundle update inherited_resources
. More infos here: https://github.com/josevalim/inherited_resources/issues/350
No hay solución correcta
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow