rosa-build/app/helpers/activity_feeds_helper.rb

17 lines
636 B
Ruby
Raw Normal View History

module ActivityFeedsHelper
def render_activity_feed(activity_feed)
2014-01-21 04:51:49 +00:00
render activity_feed.partial, activity_feed.data.merge(activity_feed: activity_feed)
end
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
2013-02-25 07:50:53 +00:00
2013-11-26 18:39:30 +00:00
def user_link(user, user_name, full_url = false)
user.persisted? ? link_to(user_name, full_url ? user_url(user) : user_path(user)) : user_name
2013-02-25 07:50:53 +00:00
end
end