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
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 |
#new ⇒ Object
6 7 8 |
# File 'app/controllers/forem/posts_controller.rb', line 6 def new @post = @topic.posts.build end |