<?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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	>
<channel>
	<title>Comments on: Ruby on Rails Snippet for Changing Relative Paths to Absolute</title>
	<atom:link href="http://garrickvanburen.com/archive/ruby-on-rails-snippet-for-changing-relative-paths-to-absolute/feed" rel="self" type="application/rss+xml" />
	<link>http://garrickvanburen.com/archive/ruby-on-rails-snippet-for-changing-relative-paths-to-absolute</link>
	<description>User Experience Strategy, Ruby and Rails Web App Development</description>
	<lastBuildDate>Sat, 20 Mar 2010 20:37:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: vague</title>
		<link>http://garrickvanburen.com/archive/ruby-on-rails-snippet-for-changing-relative-paths-to-absolute/comment-page-1#comment-56743</link>
		<dc:creator>vague</dc:creator>
		<pubDate>Fri, 25 Jul 2008 11:47:11 +0000</pubDate>
		<guid isPermaLink="false">http://garrickvanburen.com/?p=1500#comment-56743</guid>
		<description>You could use either blocks or string interpolation to get rid of the hacky * thing.

With Interpolation:
&lt;code&gt;
content.gsub(/=(&#039;&#124;&quot;)\//, &quot;=\\1#{link.match(/(http&#124;https):\/\/[\w.]+\//)[0]}./&quot;)
&lt;/code&gt;

With a block:
&lt;code&gt;
content.gsub(/=(&#039;&#124;&quot;)\//) {&#124;m&#124; &quot;=#$1%s/&quot; % link.match(/(http&#124;https):\/\/[\w.]+\//)[0]}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>You could use either blocks or string interpolation to get rid of the hacky * thing.</p>
<p>With Interpolation:<br />
<code><br />
content.gsub(/=('|")\//, "=\\1#{link.match(/(http|https):\/\/[\w.]+\//)[0]}./")<br />
</code></p>
<p>With a block:<br />
<code><br />
content.gsub(/=('|")\//) {|m| "=#$1%s/" % link.match(/(http|https):\/\/[\w.]+\//)[0]}<br />
</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
