Jon A. Lambert wrote:> Is there any way to access the query string full request uri in
> routes.rb?
>
> I''d like to route requests for those going after my old
application urls
> to
> my new rails application urls.
>
> The old app used
> /wiki.cgi?PageName
> The rails app uses
> /wiki/show/PageName
>
> Like...
> map.connect ''wiki.cgi'', :controller =>
"wiki", :action => "show", :id
> J. Lambert
map.connect ''wiki.cgi?:id'', :controller =>
"wiki", :action => "show",
:id => :id
The above should work, but it will still show wiki.cgi?PageName in the
browser. You could add an action to your wiki controller to redirect:
def redirect
redirect_to :controller => "wiki", :action =>
"show", :id =>
params[:id]
end
The the route would be:
map.connect ''wiki.cgi?:id'', :controller =>
"wiki", :action =>
"redirect", :id => :id
--
Posted via http://www.ruby-forum.com/.