add helper file
This commit is contained in:
parent
2d6a69cdc8
commit
4bff560a30
1 changed files with 11 additions and 0 deletions
11
app/helpers/notifier_helper.rb
Normal file
11
app/helpers/notifier_helper.rb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
module NotifierHelper
|
||||
def post_message(post, opts={})
|
||||
if post.respond_to? :formatted_message
|
||||
message = truncate(post.formatted_message(:plain_text => true), :length => 200)
|
||||
message = process_newlines(message) if opts[:process_newlines]
|
||||
message
|
||||
else
|
||||
I18n.translate 'notificer.a_post'
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue