Skip to content

Instantly share code, notes, and snippets.

@candland
Created March 8, 2011 01:13
Show Gist options
  • Select an option

  • Save candland/859651 to your computer and use it in GitHub Desktop.

Select an option

Save candland/859651 to your computer and use it in GitHub Desktop.
Shorten text helper
def shorten(description, length)
return truncate(description.gsub(/(<[^>]+>)/, ''), :length => length, :omission => "...")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment