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
8 9 10 11 12 |
# File 'app/controllers/forem/posts_controller.rb', line 8 def create @post = @topic.posts.create(params[:post].merge!(user_id: current_user.id)) flash[:notice] = "Post has been created!" redirect_to topic_path(@topic) end |
#new ⇒ Object
5 6 7 |
# File 'app/controllers/forem/posts_controller.rb', line 5 def new @post = @topic.posts.build end |