method
sanitized
v8.1.1 -
Show latest stable
- Class:
ActiveStorage::Filename
sanitized()public
Returns the sanitized filename.
ActiveStorage::Filename.new("foo:bar.jpg").sanitized # => "foo-bar.jpg" ActiveStorage::Filename.new("foo/bar.jpg").sanitized # => "foo-bar.jpg"
Characters considered unsafe for storage (e.g. , $, and the RTL override character) are replaced with a dash.