Topic: Need help uploading audio
Hi, I have a small problem with my website.
I have two attachments to each "thing" a photograph and an audioclip. I'm using Paperclip to achieve this.
So far uploading images works. They go right where they're supposed to - the audio files also go where they are supposed to.
I'm using this code in the model to achieve this, the problem comes later...
class Thing < ActiveRecord::Base
has_attached_file :photograph ,
:url => "/assets/things/:id/original/:basename.:extension",
:path => ":rails_root/public/assets/things/:id/original/:basename.:extension"
has_attached_file :audio ,
:url => "/assets/things/:id/original/basename.:extension",
:path => ":rails_root/public/assets/things/:id/original/:basename.:extension"
attr_accessor :audio_file_name
attr_accessor :audio_content_type
attr_accessor :audio_file_size
attr_accessor :audio_updated_at
end
When I try to get a link to my audio files with this code in the views...
<% @things.each do |thing| %>
<tr>
<td><%= image_tag thing.photograph %>
</tr>
<tr>
<td><%= thing.audio.url %>
</tr>
<% end %>
I certainly get all the images on the page just like they are supposed to but the output for thing.audio.url is /audios/original/missing.png.
I'm new to Ruby and would really appreciate help figuring this out. Thanks.