Rails 4 Unpermitted Parameters for Array

前端 未结 5 799
忘掉有多难
忘掉有多难 2020-12-07 22:07

I have an array field in my model and I\'m attempting to update it.

My strong parameter method is below

def post_params
  params[\"post\"][\"categor         


        
5条回答
  •  青春惊慌失措
    2020-12-07 22:43

    Try this

    params.require(:post).permit(:name, :email, :categories => [])
    

    (Disregard my comment, I don't think that matters)

提交回复
热议问题