Module: Blog::Gem::ApplicationHelper

Defined in:
app/helpers/blog/gem/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#facebook_html(html) ⇒ Object



4
5
6
7
8
9
10
# File 'app/helpers/blog/gem/application_helper.rb', line 4

def facebook_html(html)
  doc = Nokogiri::HTML(html)
  doc.search('a').each do |link|
    link.content = "#{link.content} (#{link.attributes["href"].value})"
  end
  doc.to_html
end