I use paperclip to attach excel file to mode.
The goal is to import data from an excel file into a database.
Model: Import
has_attached_file: spreadsheet
For the import process, I want to access the file in my model as follows.
path = "#{Rails.root}/public/#{spreadsheet.url}"
This does not work. I think because in the end the url has a timestamp.
In general, what is the best way to access server-side attachments?
source
share