Skip to content

Instantly share code, notes, and snippets.

@vparihar01
Created June 2, 2013 18:46
Show Gist options
  • Save vparihar01/5694460 to your computer and use it in GitHub Desktop.
Save vparihar01/5694460 to your computer and use it in GitHub Desktop.
class YourModel
before_save :sanitize_name
private
def sanitize_name
self.name = CGI::escapeHTML(name)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment