lib/generators/talkie/templates/talkie.rb in talkie-0.2.0 vs lib/generators/talkie/templates/talkie.rb in talkie-0.3.0

- old
+ new

@@ -27,11 +27,10 @@ # config.creator_path = lambda { |user, router| router.profile_path(user) } # # The default looks like: # config.creator_path = lambda { |user, router| "#" } - # ==> Creator avatar url # Configure the avatar url for the comment creator # By default it will use a http:////api.adorable.io/avatars/40/abott@adorable.png # Notice you need to set it to a lambda function, which receives: # a user which is mandatory @@ -41,10 +40,38 @@ # 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" } + + # ==> Mentions support + # If you decide to enable mentions, be aware on some further configuration + # The first thing to do is to just enable it: # + # config.enable_mentions = true + # + # By default it will send an email to notify the mentioned users + # but you can override this default configuration like: + # + # config.enable_mentions_notifications = false + # + # You can override the query that filter the mentionees + # By default the lambda function is + # config.mentions_scope_query = lambda { |query| where("email LIKE ?", "#{query}%") } + # Just keep in mind that the query variable is what you receive when the user + # types '@' on the textarea, so maybe kurenn@icalialabs.com or so + # You can change to obey a username column, like so: + # + # config.mentions_scope_query = lambda { |query| where("username ILIKE ?", "%#{query}%") } + # + # There is another configuration for the mention module you may want to look at it + # The autocomplete text, which is by default the email, but probably that would look nasty, + # you can override this and use any method or attribute you want for your talker class: + # + # config.autocomplete_mention_display = lambda { |mentionee| mentionee.username } + # + # Or maybe something more complex + # config.autocomplete_mention_display = lambda { |mentionee| "#{mentionee.first_name} #{mentionee.last_name}" } # ==> 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