after_create do |post|
post.user.nil?
end
def create
post = current_user.posts.create(post_params)
redirect_to post
end
def create
post = current_user.posts << Post.create(post_params)
redirect_to post
end
def create
transaction do
post = Post.create(post_params)
post.user = current_user
post.save
end
redirect_to post
end