<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - Need help uploading audio]]></title>
		<link>http://railsforum.com/viewtopic.php?id=49422</link>
		<description><![CDATA[The most recent posts in Need help uploading audio.]]></description>
		<lastBuildDate>Wed, 04 Jul 2012 22:15:07 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Need help uploading audio]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=153762#p153762</link>
			<description><![CDATA[<p>Hi, I have a small problem with my website.</p><p>I have two attachments to each &quot;thing&quot; a photograph and an audioclip. I&#039;m using Paperclip to achieve this.</p><p>So far uploading images works. They go right where they&#039;re supposed to - the audio files also go where they are supposed to.</p><p>I&#039;m using this code in the model to achieve this, the problem comes later...</p><p><span style="color: grey"><br />class Thing &lt; ActiveRecord::Base<br />&nbsp; has_attached_file :photograph ,<br />&nbsp; :url&nbsp; =&gt; &quot;/assets/things/:id/original/:basename.:extension&quot;,<br />&nbsp; :path =&gt; &quot;:rails_root/public/assets/things/:id/original/:basename.:extension&quot;</span></p><p><span style="color: grey">&nbsp; has_attached_file :audio ,<br />&nbsp; :url =&gt; &quot;/assets/things/:id/original/basename.:extension&quot;,<br />&nbsp; :path =&gt; &quot;:rails_root/public/assets/things/:id/original/:basename.:extension&quot;</span></p><p><span style="color: grey">&nbsp; attr_accessor :audio_file_name<br />&nbsp; attr_accessor :audio_content_type<br />&nbsp; attr_accessor :audio_file_size<br />&nbsp; attr_accessor :audio_updated_at<br />end<br /></span></p><p>When I try to get a link to my audio files with this code in the views...<br /><span style="color: grey"><br />&nbsp; &nbsp; &nbsp; &lt;% @things.each do |thing| %&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;%= image_tag thing.photograph %&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;%= thing.audio.url %&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&nbsp; &nbsp; &nbsp; &lt;% end %&gt;<br /></span><br />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.</p><p>I&#039;m new to Ruby and would really appreciate help figuring this out. Thanks.</p>]]></description>
			<author><![CDATA[dummy@example.com (Strapisa)]]></author>
			<pubDate>Wed, 04 Jul 2012 22:15:07 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=153762#p153762</guid>
		</item>
	</channel>
</rss>
