implement current_user

This commit is contained in:
João Victor Geonizeli
2022-02-28 09:48:51 -03:00
parent 6cc48afcb1
commit e465123190
7 changed files with 35 additions and 29 deletions

View File

@@ -27,6 +27,9 @@ class PostsController < ApplicationController
# Only allow a list of trusted parameters through.
def post_params
params.require(:post).permit(:content, :user_id, :quoted_post_id)
{
user: current_user,
**params.require(:post).permit(:content, :quoted_post_id)
}
end
end