app/controllers/talkie/comments_controller.rb in talkie-0.1.1 vs app/controllers/talkie/comments_controller.rb in talkie-0.2.0
- old
+ new
@@ -7,13 +7,15 @@
@comment.creator = current_user
respond_to do |format|
if @comment.save
make_child_comment if reply?
- format.html { redirect_to main_app.polymorphic_path(@comment.commentable), notice: "Comment was successfully added." }
+ format.html { redirect_to Talkie.success_redirect_to.call(main_app, @comment.commentable),
+ notice: t('talkie.controllers.comments.flash.success') }
format.js
else
- format.html { redirect_to :back, notice: "Something went wrong, blank comments are not allowed" }
+ format.html { redirect_back fallback_location: Talkie.fail_redirect_to.call(main_app),
+ notice: t('talkie.controllers.comments.flash.error') }
format.js
end
end
end