<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: image_url function in Ruby on Rails</title>
	<atom:link href="http://stick.gk2.sk/blog/2009/12/image_url-function-in-ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://stick.gk2.sk/blog/2009/12/image_url-function-in-ruby-on-rails/</link>
	<description>Look at you, hacker. A pathetic creature of meat and bone. How can you challenge a perfect, immortal machine?</description>
	<lastBuildDate>Wed, 21 Jul 2010 12:29:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Jay</title>
		<link>http://stick.gk2.sk/blog/2009/12/image_url-function-in-ruby-on-rails/comment-page-1/#comment-15677</link>
		<dc:creator>Jay</dc:creator>
		<pubDate>Wed, 16 Jun 2010 09:44:33 +0000</pubDate>
		<guid isPermaLink="false">http://stick.gk2.sk/?p=997#comment-15677</guid>
		<description>Could you help me please? I cannot use this in email layout, somehow...

in application_helper.rb I have
 def image_url(source)
   abs_path = image_path(source)
   unless abs_path =~ /^http/
     abs_path = &quot;#{request.protocol}#{request.host_with_port}#{abs_path}&quot;
   end
   abs_path
 end
and in my email model (order_mailer.rb) I have
class OrderMailer &lt; ActionMailer::Base
 layout &#039;emails&#039;
 . . .
end

but when I use  I get
undefined method `image_url&#039; for #

This doesn&#039;t work either:

class OrderMailer &lt; ActionMailer::Base
 include ApplicationHelper
 layout &#039;emails&#039;
 . . .
end</description>
		<content:encoded><![CDATA[<p>Could you help me please? I cannot use this in email layout, somehow&#8230;</p>
<p>in application_helper.rb I have<br />
 def image_url(source)<br />
   abs_path = image_path(source)<br />
   unless abs_path =~ /^http/<br />
     abs_path = &#8220;#{request.protocol}#{request.host_with_port}#{abs_path}&#8221;<br />
   end<br />
   abs_path<br />
 end<br />
and in my email model (order_mailer.rb) I have<br />
class OrderMailer &lt; ActionMailer::Base<br />
 layout &#039;emails&#039;<br />
 . . .<br />
end</p>
<p>but when I use  I get<br />
undefined method `image_url&#8217; for #</p>
<p>This doesn&#8217;t work either:</p>
<p>class OrderMailer &lt; ActionMailer::Base<br />
 include ApplicationHelper<br />
 layout &#039;emails&#039;<br />
 . . .<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavol Rusnak</title>
		<link>http://stick.gk2.sk/blog/2009/12/image_url-function-in-ruby-on-rails/comment-page-1/#comment-10307</link>
		<dc:creator>Pavol Rusnak</dc:creator>
		<pubDate>Tue, 29 Dec 2009 21:50:59 +0000</pubDate>
		<guid isPermaLink="false">http://stick.gk2.sk/?p=997#comment-10307</guid>
		<description>&lt;a href=&quot;#comment-10306&quot; rel=&quot;nofollow&quot;&gt;@joserwan &lt;/a&gt; 
I know about image_path. It is even used in the code! The problem is that image_path does not always create a full URL.</description>
		<content:encoded><![CDATA[<p><a href="#comment-10306" rel="nofollow">@joserwan </a><br />
I know about image_path. It is even used in the code! The problem is that image_path does not always create a full URL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joserwan</title>
		<link>http://stick.gk2.sk/blog/2009/12/image_url-function-in-ruby-on-rails/comment-page-1/#comment-10306</link>
		<dc:creator>joserwan</dc:creator>
		<pubDate>Tue, 29 Dec 2009 19:38:23 +0000</pubDate>
		<guid isPermaLink="false">http://stick.gk2.sk/?p=997#comment-10306</guid>
		<description>See image_path(source) : http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#M001720</description>
		<content:encoded><![CDATA[<p>See image_path(source) : <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#M001720" rel="nofollow">http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#M001720</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
