Skip to content

Instantly share code, notes, and snippets.

@jmccartie
Created May 17, 2011 18:45
Show Gist options
  • Save jmccartie/977088 to your computer and use it in GitHub Desktop.
Save jmccartie/977088 to your computer and use it in GitHub Desktop.
Strip HTML from ALL item descriptions
Item.all.each {|item| item.update_attributes(description: Nokogiri::HTML(item.description).xpath("//text()").remove.to_s) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment