<?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: RELEASE: Redirect Routing Plugin for Rails</title>
	<atom:link href="http://pinds.com/2006/07/18/release-redirect-routing-plugin-for-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://pinds.com/2006/07/18/release-redirect-routing-plugin-for-rails/</link>
	<description>my personal blog about entrepreneurship and tech stuff</description>
	<lastBuildDate>Thu, 04 Feb 2010 16:33:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Pelle</title>
		<link>http://pinds.com/2006/07/18/release-redirect-routing-plugin-for-rails/comment-page-1/#comment-1089</link>
		<dc:creator>Pelle</dc:creator>
		<pubDate>Tue, 18 Jul 2006 22:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://pinds.com/2008/06/25/release-redirect-routing-plugin-for-rails#comment-1089</guid>
		<description>Very useful. I will definitely use it.</description>
		<content:encoded><![CDATA[<p>Very useful. I will definitely use it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jarkko Laine</title>
		<link>http://pinds.com/2006/07/18/release-redirect-routing-plugin-for-rails/comment-page-1/#comment-1090</link>
		<dc:creator>Jarkko Laine</dc:creator>
		<pubDate>Tue, 18 Jul 2006 22:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://pinds.com/2008/06/25/release-redirect-routing-plugin-for-rails#comment-1090</guid>
		<description>Very cool, Lars. That sounds extremely useful for supporting legacy url&#039;s. Any plans to make it support variables/regexps?

Like:

&lt;code&gt;&lt;pre&gt;
map.redirect &#039;blog/:id&#039;,
   Proc.new{&#124;id&#124;
        @post = Post.find(id)
        {:day =&gt; @post.day, ... , :title =&gt; @post.title}
  }
&lt;/pre&gt;&lt;/code&gt;

Ok, maybe that was a bit too involved... but it *would* make supporting textpattern-type url&#039;s easy in Typo :-)</description>
		<content:encoded><![CDATA[<p>Very cool, Lars. That sounds extremely useful for supporting legacy url&#8217;s. Any plans to make it support variables/regexps?</p>
<p>Like:</p>
<p>&lt;code&gt;&lt;pre&gt;<br />
map.redirect &#8216;blog/:id&#8217;,<br />
   Proc.new{|id|<br />
        @post = Post.find(id)<br />
        {:day =&gt; @post.day, &#8230; , :title =&gt; @post.title}<br />
  }<br />
&lt;/pre&gt;&lt;/code&gt;</p>
<p>Ok, maybe that was a bit too involved&#8230; but it *would* make supporting textpattern-type url&#8217;s easy in Typo <img src='http://pinds.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lars Pind</title>
		<link>http://pinds.com/2006/07/18/release-redirect-routing-plugin-for-rails/comment-page-1/#comment-1091</link>
		<dc:creator>Lars Pind</dc:creator>
		<pubDate>Tue, 18 Jul 2006 22:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://pinds.com/2008/06/25/release-redirect-routing-plugin-for-rails#comment-1091</guid>
		<description>Interesting idea.

I&#039;m thinking the routes should stay declarative. They&#039;re not meant as a replacement for controllers.

I could see how you&#039;d want to do some simple regsubbing or use of parameters, but I think it ends there.</description>
		<content:encoded><![CDATA[<p>Interesting idea.</p>
<p>I&#8217;m thinking the routes should stay declarative. They&#8217;re not meant as a replacement for controllers.</p>
<p>I could see how you&#8217;d want to do some simple regsubbing or use of parameters, but I think it ends there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thijs van der Vossen</title>
		<link>http://pinds.com/2006/07/18/release-redirect-routing-plugin-for-rails/comment-page-1/#comment-1092</link>
		<dc:creator>Thijs van der Vossen</dc:creator>
		<pubDate>Tue, 18 Jul 2006 22:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://pinds.com/2008/06/25/release-redirect-routing-plugin-for-rails#comment-1092</guid>
		<description>Very nice! Would be great to have this in Rails by default. Why not try to get it in there for the next release?</description>
		<content:encoded><![CDATA[<p>Very nice! Would be great to have this in Rails by default. Why not try to get it in there for the next release?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lars Pind</title>
		<link>http://pinds.com/2006/07/18/release-redirect-routing-plugin-for-rails/comment-page-1/#comment-1093</link>
		<dc:creator>Lars Pind</dc:creator>
		<pubDate>Tue, 18 Jul 2006 22:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://pinds.com/2008/06/25/release-redirect-routing-plugin-for-rails#comment-1093</guid>
		<description>The only problem is that I&#039;m creating a special controller behind the scenes and then leveraging the normal controller and response&#039;s url rewriting and redirecting capabilities.

The rewriting part is actually handled by the Routing system, so that should be easy, and sending the redirect is trivial, so that could be done as well, but it wouldn&#039;t be completely DRY.

If there&#039;s interest from core I&#039;ll be happy to explore.</description>
		<content:encoded><![CDATA[<p>The only problem is that I&#8217;m creating a special controller behind the scenes and then leveraging the normal controller and response&#8217;s url rewriting and redirecting capabilities.</p>
<p>The rewriting part is actually handled by the Routing system, so that should be easy, and sending the redirect is trivial, so that could be done as well, but it wouldn&#8217;t be completely DRY.</p>
<p>If there&#8217;s interest from core I&#8217;ll be happy to explore.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: robin</title>
		<link>http://pinds.com/2006/07/18/release-redirect-routing-plugin-for-rails/comment-page-1/#comment-1094</link>
		<dc:creator>robin</dc:creator>
		<pubDate>Tue, 18 Jul 2006 22:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://pinds.com/2008/06/25/release-redirect-routing-plugin-for-rails#comment-1094</guid>
		<description>when i put this in my vendors/plugins I get the following...

... /dependencies.rb:123:in `const_missing&#039;: uninitialized constant Mapper (NameError)
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in `const_missing&#039;

rails don&#039;t start..

something I&#039;m missing?</description>
		<content:encoded><![CDATA[<p>when i put this in my vendors/plugins I get the following&#8230;</p>
<p>&#8230; /dependencies.rb:123:in `const_missing&#8217;: uninitialized constant Mapper (NameError)<br />
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in `const_missing&#8217;</p>
<p>rails don&#8217;t start..</p>
<p>something I&#8217;m missing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lars Pind</title>
		<link>http://pinds.com/2006/07/18/release-redirect-routing-plugin-for-rails/comment-page-1/#comment-1095</link>
		<dc:creator>Lars Pind</dc:creator>
		<pubDate>Tue, 18 Jul 2006 22:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://pinds.com/2008/06/25/release-redirect-routing-plugin-for-rails#comment-1095</guid>
		<description>Did I mention this only works with edge and the rewritten routing implementation?</description>
		<content:encoded><![CDATA[<p>Did I mention this only works with edge and the rewritten routing implementation?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Butler</title>
		<link>http://pinds.com/2006/07/18/release-redirect-routing-plugin-for-rails/comment-page-1/#comment-1096</link>
		<dc:creator>Daniel Butler</dc:creator>
		<pubDate>Tue, 18 Jul 2006 22:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://pinds.com/2008/06/25/release-redirect-routing-plugin-for-rails#comment-1096</guid>
		<description>I get the same error as robin while I&#039;m trying to set this up on a customized Typo installation, which is pegged to non-edge Rails. Anyone have any suggestions about how to accomplish redirects (or support for legacy URLs) without this plugin?</description>
		<content:encoded><![CDATA[<p>I get the same error as robin while I&#8217;m trying to set this up on a customized Typo installation, which is pegged to non-edge Rails. Anyone have any suggestions about how to accomplish redirects (or support for legacy URLs) without this plugin?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Barber</title>
		<link>http://pinds.com/2006/07/18/release-redirect-routing-plugin-for-rails/comment-page-1/#comment-1097</link>
		<dc:creator>Craig Barber</dc:creator>
		<pubDate>Tue, 18 Jul 2006 22:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://pinds.com/2008/06/25/release-redirect-routing-plugin-for-rails#comment-1097</guid>
		<description>I altered your plugin to support:

  map.redirect &#039;/old_controller/:action&#039;,
    :controller =&gt; &#039;new_controller&#039;

by adding the following to RedirectRoutingController:

  def method_missing(action)
    redirect_to params[:url_options].merge({ :action =&gt; action })
  end

P.S. - I *really* like the automatic code detection. Is that part of typo?</description>
		<content:encoded><![CDATA[<p>I altered your plugin to support:</p>
<p>  map.redirect &#8216;/old_controller/:action&#8217;,<br />
    :controller =&gt; &#8216;new_controller&#8217;</p>
<p>by adding the following to RedirectRoutingController:</p>
<p>  def method_missing(action)<br />
    redirect_to params[:url_options].merge({ :action =&gt; action })<br />
  end</p>
<p>P.S. &#8211; I *really* like the automatic code detection. Is that part of typo?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee Iverson</title>
		<link>http://pinds.com/2006/07/18/release-redirect-routing-plugin-for-rails/comment-page-1/#comment-1098</link>
		<dc:creator>Lee Iverson</dc:creator>
		<pubDate>Tue, 18 Jul 2006 22:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://pinds.com/2008/06/25/release-redirect-routing-plugin-for-rails#comment-1098</guid>
		<description>OK, so I bit the (very soft) bullet and got this working with regexps in the redirect options.  The changes are simple:

&lt;pre&gt;
module RedirectRouting
  module Routes
    def redirect(path, options={})
      url_options = { }
      connect_options = {
        :controller =&gt; &quot;redirect_routing&quot;, :action =&gt; &quot;redirect&quot;,
        :url_options =&gt; url_options }
      options.each do &#124;key,value&#124;
        if [:controller, :action].include?(key)
          url_options[key] = value
        else
          connect_options[key] = value
        end
      end
      connect path, connect_options
    end
  end
end
&lt;/pre&gt;

and

&lt;pre&gt;
class RedirectRoutingController &lt; ActionController::Base
  def redirect
    url_options = params.delete(:url_options)
    redirect_to params.merge(url_options)
  end
end
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>OK, so I bit the (very soft) bullet and got this working with regexps in the redirect options.  The changes are simple:</p>
<p>&lt;pre&gt;<br />
module RedirectRouting<br />
  module Routes<br />
    def redirect(path, options={})<br />
      url_options = { }<br />
      connect_options = {<br />
        :controller =&gt; &quot;redirect_routing&quot;, :action =&gt; &quot;redirect&quot;,<br />
        :url_options =&gt; url_options }<br />
      options.each do |key,value|<br />
        if [:controller, :action].include?(key)<br />
          url_options[key] = value<br />
        else<br />
          connect_options[key] = value<br />
        end<br />
      end<br />
      connect path, connect_options<br />
    end<br />
  end<br />
end<br />
&lt;/pre&gt;</p>
<p>and</p>
<p>&lt;pre&gt;<br />
class RedirectRoutingController &lt; ActionController::Base<br />
  def redirect<br />
    url_options = params.delete(:url_options)<br />
    redirect_to params.merge(url_options)<br />
  end<br />
end<br />
&lt;/pre&gt;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
