I need save files with russian name or transliterate file name. I try this:
1) In document_uploader:
def filename
@name ||= "#{Russian::transliterate(original_filename)}.#{file.extension}" if original_filename.present?
end
2) In document.rb:
I create before_create callback method with the same logic but not see any results.
Name of file after uploading like this: “______________.doc”
What I should do?
If you’re using ruby 1.9, you can sanitize the file name, it’s likley because the characters are not unicode: