How to permit all attributes besides user_id using strong_parameters?

ruby, ruby-on-rails, ruby-on-rails-4, strong-parameters

Solution

will this work?

params.require(:answer).permit!.except(:user_id)

Problem

I would like to use something like that: ``` def answer_params params.require(:answer).permit!.without(:user_id) end ```

Original source