I have a problem when using paperclip.
I can see the files uploaded but now i want to have a download link to download the “pdf file” when clicking on it.
I see this example:
<%= link_to "Download", model.whatever.url(:original, false) %>
But I can’t figure out how to implement this with my own views and models.
Hope someone can help me.
EDIT:
here is my model:
class Contractgegeven < ActiveRecord::Base
has_attached_file :pdf
attr_accessible :bedrijfsonderdeel, :bestemd_voor, :betalingsgegevens, :betreft, :contractbeheerder, :contractduur, :einddatum, :ingangsdatum, :opzegtermijn, :soort_contract, :pdf
end
Say your model is
Image, and you have :Then you should write:
not
Image.last.url(:original, false)