2012-03-22 17:11:12 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2012-01-25 08:31:49 +00:00
|
|
|
module ActivityFeedsHelper
|
2012-01-26 17:04:58 +00:00
|
|
|
def render_activity_feed(activity_feed)
|
2012-03-05 09:11:50 +00:00
|
|
|
render :partial => activity_feed.partial, :locals => activity_feed.data.merge(:activity_feed => activity_feed)
|
2012-01-26 17:04:58 +00:00
|
|
|
end
|
2012-04-17 16:38:02 +01:00
|
|
|
|
|
|
|
def get_feed_title_from_content(content)
|
|
|
|
# removes html tags and haml generator indentation whitespaces and new line chars:
|
|
|
|
feed_title = strip_tags(content).gsub(/(^\s+|\n| )/, ' ')
|
|
|
|
# removes multiple whitespaces in a row and strip it:
|
|
|
|
feed_title = feed_title.gsub(/\s{2,}/, ' ').strip
|
|
|
|
end
|
2012-01-25 08:31:49 +00:00
|
|
|
end
|