gmoniey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-18 20:16 UTC
static urls for dynamic conent (routing question)
Hi, I wanna provide static urls for my users, and I figured out that I can do it with the following: map.user '':username'', :controller => ''users'', :action => ''show'' however, I also have the following in my routes.rb, which essentially creates a default controller: map.account '':action/:id'', :controller => "account" basically, this shortens my urls, where i once had: www.mysite.com/account/login, now can be accessed by www.mysite.com/login (there are many other commonly used actions in the account controller) My problem is i cant have both of these lines together in my routes.rb...basically, whichever one comes first, takes priority, and wont let the other one behave as expected. For example, if the map.user is first, and I enter: www.mysite.com/login, I will get an error sayin to user: ''login'' found....if I put map.account first, and enter www.mysite.com/userA, I will get an error sayin no action userA found in controller account. Does anyone know how to get around this? Is there a way to call a default action in my account controller if no action is found? i can search for a user that way. Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---