Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/images_gallery.rb
Instance Method Summary collapse
-
#to_filename ⇒ Object
Sanitize a name so it can be used as part of an URL.
Instance Method Details
#to_filename ⇒ Object
Sanitize a name so it can be used as part of an URL
7 8 9 |
# File 'lib/images_gallery.rb', line 7 def to_filename downcase.gsub(/\W/, '_').gsub(/_+/, '_').gsub(/_\Z/, '') end |