Module: Thredded::PostsControllerWhichRedirects
- Included in:
- PostsController
- Defined in:
- app/controllers/thredded/posts_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/thredded/posts_controller.rb', line 7 def create @post_form = Thredded::PostForm.new( user: thredded_current_user, topic: parent_topic, post_params: new_post_params ) @post_form.post if @post_form.save # TODO: extract as a hook on thredded#posts_controller `after_create(post)` redirect_after_create(@post_form.post) else render :new end end |