instance method
base
Ruby on Rails 8.1.2
Since v5.2.8.1Signature
base()
Returns the part of the filename preceding any extension.
ActiveStorage::Filename.new("racecar.jpg").base # => "racecar" ActiveStorage::Filename.new("racecar").base # => "racecar" ActiveStorage::Filename.new(".gitignore").base # => ".gitignore"
Source
# File activestorage/app/models/active_storage/filename.rb, line 27
def base
File.basename @filename, extension_with_delimiter
end
Defined in activestorage/app/models/active_storage/filename.rb line 27
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Filename