So, there is a working part of code in rails 5. I'm making huge form with nested attributes on many levels. I've got an strong params list:
params.require(:lexeme).permit(
:word, :homonym_number, :see_other_lexeme_id, :semantic_description, :afterword,
variants_attributes: [ :word, :id, :_destroy, proofs_attributes: [ :word, :language_id, :meaning, :id, :_destroy, language_mode_ids: [] ] ]
)
And when I tried to change order a little bit...
params.require(:lexeme).permit(
:word, :homonym_number, :see_other_lexeme_id, :semantic_description, :afterword,
variants_attributes: [ :word, :id, :_destroy, proofs_attributes: [ :word, :language_id, :meaning, :id, language_mode_ids: [], :_destroy ] ]
)
I'm getting:
syntax error, unexpected ']', expecting =>
...guage_mode_ids: [], :_destroy ] ]
... ^):
So, rails masters, what is wrong with this simple syntax here, has always array parameters need to be placed as last? What if I have more arrays in params?