added seed data
This commit is contained in:
@@ -12,7 +12,7 @@ class PostsController < ApplicationController
|
||||
end
|
||||
|
||||
def create
|
||||
@post.user = current_user
|
||||
@post.user ||= current_user
|
||||
if @post.save
|
||||
flash[:notice] = "Post was successfully created."
|
||||
redirect_to topic_path(@post.topic)
|
||||
|
||||
Reference in New Issue
Block a user