I think you need two routes for this particular task:
map.connect ''page/edit'', :controller =>
''login''
map.connect ''page/*/edit'', :controller =>
''login''
It''s not the strikingly elegant solution you probably wanted, but it
should work.
---
Jim Kane
http://jim.eponym.com/
fastjames@gmail.com
On Jul 14, 2006, at 4:47 AM, Gijs Nijholt wrote:
> Hello railslist,
>
> I''m trying to accomplish the following:
>
> The URL http://localhost:3000/page/news/edit
> should redirect to the URL http://localhost:3000/login
>
> I''ve accomplished this by setting up a route like:
>
> map.connect ''page/:name/edit'', :controller =>
"login"
>
> But this fails in the case of the following URL:
> http://localhost:3000/page/news/article4000/edit
>
> How can I set up a route that just detects if the URL starts with
> /page and ends with /edit?
> I''ve tried using route globbing, (by using an asterix symbol) but
I
> don''t really understand its use. I put it like:
> map.connect ''page/*/edit'', :controller =>
"login"
> (..but this neglects the /edit)
>
> Can or should I use regular expressions for this? And how do I fit
> that in?
> Thanks in advance,
>
> Gijs Nijholt
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060717/a9628000/attachment.html