<?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: Reconstructing Request URIs in Rails</title>
	<atom:link href="http://www.igvita.com/2007/07/31/reconstructing-request-uris-in-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.igvita.com/2007/07/31/reconstructing-request-uris-in-rails/</link>
	<description>A goal is a dream with a deadline.</description>
	<pubDate>Sat, 04 Jul 2009 23:19:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mr Frosti</title>
		<link>http://www.igvita.com/2007/07/31/reconstructing-request-uris-in-rails/comment-page-1/#comment-185403</link>
		<dc:creator>Mr Frosti</dc:creator>
		<pubDate>Thu, 16 Apr 2009 15:34:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/07/31/reconstructing-request-uris-in-rails/#comment-185403</guid>
		<description>@Matt @Ilya

I think this can be simplified by using the request.request_uri method, as Matt suggested, then chopping off the controller name prefix as Ilya points out. 

In my controller, I set params[:source] equal to the following:

request.request_uri[/\/#{controller_name}\/(.*)/,1]</description>
		<content:encoded><![CDATA[<p>@Matt @Ilya</p>
<p>I think this can be simplified by using the request.request_uri method, as Matt suggested, then chopping off the controller name prefix as Ilya points out. </p>
<p>In my controller, I set params[:source] equal to the following:</p>
<p>request.request_uri[/\/#{controller_name}\/(.*)/,1]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ilya Grigorik</title>
		<link>http://www.igvita.com/2007/07/31/reconstructing-request-uris-in-rails/comment-page-1/#comment-101478</link>
		<dc:creator>Ilya Grigorik</dc:creator>
		<pubDate>Tue, 12 Feb 2008 11:49:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/07/31/reconstructing-request-uris-in-rails/#comment-101478</guid>
		<description>Kris, it sounds like your routes are not catching encoded urls. To handle this case, you might have to do manual overrides, or have a catch all such as:
&lt;code&gt;
route/:params, :params =&gt; /.*/
&lt;/code&gt;

Last but not least, try moving Apache and/or any reverse proxies out of the way to see if they're the ones causing this behavior.</description>
		<content:encoded><![CDATA[<p>Kris, it sounds like your routes are not catching encoded urls. To handle this case, you might have to do manual overrides, or have a catch all such as:<br />
<code><br />
route/:params, :params => /.*/<br />
</code></p>
<p>Last but not least, try moving Apache and/or any reverse proxies out of the way to see if they&#8217;re the ones causing this behavior.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris</title>
		<link>http://www.igvita.com/2007/07/31/reconstructing-request-uris-in-rails/comment-page-1/#comment-101446</link>
		<dc:creator>Kris</dc:creator>
		<pubDate>Mon, 11 Feb 2008 19:45:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/07/31/reconstructing-request-uris-in-rails/#comment-101446</guid>
		<description>I'm trying to do this project for school... an example social bookmarking site. Right now I use a bookmarklet that submits to a "save" action like so (pseudocode):

mysite.com/links/save/ExampleURIencodedURL/ExampleURIencodedTitle

My routes fill pulls the two params, URL and title, and enters them into the DB. If I enter the code above how it is, it works just fine. I submits "ExampleURIencodedURL" into the URL field and "ExampleURIencodedTitle" into the title field.

However, when I try to submit an encoded URL structure, it doesn't work. For example:

mysite.com/links/save/http%3A%2F%2Fwww.google.com/Google%20Page%20Title

doesn't work, and it throws a "Page you are looking for doesn't exist" error. Do you have any tips as to what I'm doing wrong? I'll check back on this blog post later to see if anyone has any answers. Thanks.</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying to do this project for school&#8230; an example social bookmarking site. Right now I use a bookmarklet that submits to a &#8220;save&#8221; action like so (pseudocode):</p>
<p>mysite.com/links/save/ExampleURIencodedURL/ExampleURIencodedTitle</p>
<p>My routes fill pulls the two params, URL and title, and enters them into the DB. If I enter the code above how it is, it works just fine. I submits &#8220;ExampleURIencodedURL&#8221; into the URL field and &#8220;ExampleURIencodedTitle&#8221; into the title field.</p>
<p>However, when I try to submit an encoded URL structure, it doesn&#8217;t work. For example:</p>
<p>mysite.com/links/save/http%3A%2F%2Fwww.google.com/Google%20Page%20Title</p>
<p>doesn&#8217;t work, and it throws a &#8220;Page you are looking for doesn&#8217;t exist&#8221; error. Do you have any tips as to what I&#8217;m doing wrong? I&#8217;ll check back on this blog post later to see if anyone has any answers. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curtis</title>
		<link>http://www.igvita.com/2007/07/31/reconstructing-request-uris-in-rails/comment-page-1/#comment-61897</link>
		<dc:creator>Curtis</dc:creator>
		<pubDate>Tue, 21 Aug 2007 18:33:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/07/31/reconstructing-request-uris-in-rails/#comment-61897</guid>
		<description>The design of this website is beautiful.</description>
		<content:encoded><![CDATA[<p>The design of this website is beautiful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2007-08-02 &#171; manalang</title>
		<link>http://www.igvita.com/2007/07/31/reconstructing-request-uris-in-rails/comment-page-1/#comment-56666</link>
		<dc:creator>links for 2007-08-02 &#171; manalang</dc:creator>
		<pubDate>Thu, 02 Aug 2007 04:20:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/07/31/reconstructing-request-uris-in-rails/#comment-56666</guid>
		<description>[...] Reconstructing Request URIs in Rails &#8220;Rails magic was getting in the way! Routing code was splitting the request URL, and removing all dynamic parameters! Let’s try to convince Rails to do otherwise.&#8221; (tags: rails ruby) [...]</description>
		<content:encoded><![CDATA[<p>[...] Reconstructing Request URIs in Rails &#8220;Rails magic was getting in the way! Routing code was splitting the request URL, and removing all dynamic parameters! Let’s try to convince Rails to do otherwise.&#8221; (tags: rails ruby) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ilya Grigorik</title>
		<link>http://www.igvita.com/2007/07/31/reconstructing-request-uris-in-rails/comment-page-1/#comment-56607</link>
		<dc:creator>Ilya Grigorik</dc:creator>
		<pubDate>Thu, 02 Aug 2007 01:36:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/07/31/reconstructing-request-uris-in-rails/#comment-56607</guid>
		<description>Matt, indeed, that's another way to do it. Except, if you look at REQUEST_URI, you will want to chop the other end of the string. Either one could work and your approach may be easier in most situations!</description>
		<content:encoded><![CDATA[<p>Matt, indeed, that&#8217;s another way to do it. Except, if you look at REQUEST_URI, you will want to chop the other end of the string. Either one could work and your approach may be easier in most situations!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.igvita.com/2007/07/31/reconstructing-request-uris-in-rails/comment-page-1/#comment-56120</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Tue, 31 Jul 2007 15:43:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/07/31/reconstructing-request-uris-in-rails/#comment-56120</guid>
		<description>I might be missing something but can't you use @request.request_uri or @request.env['REQUEST_URI']?

http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html#M000239</description>
		<content:encoded><![CDATA[<p>I might be missing something but can&#8217;t you use @request.request_uri or @request.env['REQUEST_URI']?</p>
<p><a href="http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html#M000239" rel="nofollow">http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html#M000239</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
