I have a similar problem, and didn't like either of these answers much. In the rails documentation (http://guides.rubyonrails.org/action_controller_overview.html#more-examples) I see the following solution:
params.fetch(:blog, {}).permit(:title, :author)
Effectively you are supplying a default of {}, which seems to work well enough (at least for my situation).
Applying to your code, you'd have:
params.fetch(:post, {}).permit(:user_id)
I think this is reasonably clean, and seems to work in my code.