Class: Forem::PostsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Forem::PostsController
- Defined in:
- app/controllers/forem/posts_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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 |
#new ⇒ Object
8 9 10 |
# File 'app/controllers/forem/posts_controller.rb', line 8 def new @post = @topic.posts.build end |