Class: Forem::PostsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/forem/posts_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



12
13
14
15
16
17
# File 'app/controllers/forem/posts_controller.rb', line 12

def create
  params[:post].merge!(:user => current_user)
  @post = @topic.posts.create(params[:post])
  flash[:notice] = "Post has been created!"
  redirect_to topic_path(@topic)
end

#newObject



8
9
10
# File 'app/controllers/forem/posts_controller.rb', line 8

def new
  @post = @topic.posts.build
end