Class: Forem::PostsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
13
14
# File 'app/controllers/forem/posts_controller.rb', line 9

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



6
7
8
# File 'app/controllers/forem/posts_controller.rb', line 6

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