lib/paperclip/interpolations.rb in dekart-paperclip-2.3.1.1 vs lib/paperclip/interpolations.rb in dekart-paperclip-2.3.1.2
- old
+ new
@@ -36,9 +36,14 @@
# Returns the filename, the same way as ":basename.:extension" would.
def filename attachment, style
"#{basename(attachment, style)}.#{extension(attachment, style)}"
end
+ # Returns escaped filename to deal with UTF filenames
+ def escaped_filename(*args)
+ CGI::escape(filename(*args))
+ end
+
# Returns the interpolated URL. Will raise an error if the url itself
# contains ":url" to prevent infinite recursion. This interpolation
# is used in the default :path to ease default specifications.
def url attachment, style
raise InfiniteInterpolationError if attachment.options[:url].include?(":url")