I'm very new to Rails. Basically, I have a Sound model that uploads an audio file(wav) and store it somewhere on the local machine (for testing). How to set it up using Paperclip? I googled but unfortunately most of the tutorials are about image uploading:-(
Any inputs are greatly appreciated.
Setting Up PaperclipTo set up Paperclip, first we need to install the ImageMagick dependency. Paperclip uses ImageMagick to resize images after upload. If you are using another system, you can get download and install instructions from the ImageMagick website. Run bundle install to finish it up.
Paperclip is an easy file attachment library for Rails Applications. Attached files are saved to the file system, database or cloud and referenced in the browser by an easily understandable specification.
class Sound
has_attached_file :audio ,
:url => "/assets/:class/:id/:attachment/:style.:extension",
:path => ":rails_root/public/assets/:class/:id/:attachment/:style.:extension"
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With