lib/generators/talkie/templates/talkie.rb in talkie-0.1.1 vs lib/generators/talkie/templates/talkie.rb in talkie-0.2.0
- old
+ new
@@ -41,6 +41,23 @@
# config.creator_avatar_url = lambda { |user| user.avatar(:thumb) }
# Make sure you return a string
#
# The default looks like:
# config.creator_avatar_url = lambda { |user| "//api.adorable.io/avatars/40/abott@adorable.png" }
+ #
+
+ # ==> Redirect for comments controller
+ # There are sometimes you want to redirect to different locations
+ # for the app on success or failure of a comment post,
+ # you can easily achieve this through the following configurations
+ #
+ # The default value for success redirection is:
+ # config.success_redirect_to = lambda { |router, commentable| router.polymorphic_path(commentable) }
+ # You can override it to anything you want. Inside this lambda function
+ # you have access to the main router and the commentable object
+ #
+ # The default value for failure redirection is:
+ # config.fail_redirect_to = lambda { |router| router.url }
+ # Inside the comments controller, the redirection would be to go back
+ # to the page where the submit came, and if not, it will go to this
+ # lambda
end