Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. doc = Nokogiri::HTML::DocumentFragment.parse(html_content)
  2.  
  3. doc.css("p.pubdate.online").each do |node|
  4. node.content = self.send("#{article_type}_released_at").strftime("%B %d, %Y")
  5. end
  6.  
  7. doc.to_html
  8.  
  9. doc = Nokogiri::HTML(html_content)
  10.  
  11. node = doc.at_css("p.pubdate.online")
  12. node.content = self.send("#{article_type}_released_at").strftime("%B %d, %Y")
  13. doc.to_html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement