method
sanitized
rails 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.