My best guess at how to make this route map.connect '':user'', :controller => ''user'', :action => ''profile'' makes my link_to :controller => ''admin'', :action => ''index'' stop working ? I''m needing urls like http://localhost:3000/username but without breaking all my other controller index actions in the process. Thanks. -- Greg Donald http://destiney.com/
Do you still have the map.connect '':controller/:action'' route at the end? On 7/23/06, Greg Donald <gdonald@gmail.com> wrote:> > My best guess at how to make this route > > map.connect '':user'', :controller => ''user'', :action => ''profile'' > > makes my > > link_to :controller => ''admin'', :action => ''index'' > > stop working ? > > I''m needing urls like http://localhost:3000/username but without > breaking all my other controller index actions in the process. > > Thanks. > > > -- > Greg Donald > http://destiney.com/ > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Kind regards, Nathaniel Brown President & CEO Inimit Innovations Inc. - http://inimit.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060723/e4245c89/attachment.html
On 7/23/06, Nathaniel Brown <nshb@inimit.com> wrote:> Do you still have the map.connect '':controller/:action'' route at the end?I have map.connect '':controller/:action/:id'' at the end. -- Greg Donald http://destiney.com/
Can you post your complete routes file? -- Andrew Stone -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060723/83c5d5a4/attachment.html
On 7/23/06, Andrew Stone <stonelists@gmail.com> wrote:> Can you post your complete routes file?ActionController::Routing::Routes.draw do |map| map.connect '':user'', :controller => ''user'', :action => ''profile'' map.connect '''', :controller => ''home'' map.connect '':controller/:action/:id'' end -- Greg Donald http://destiney.com/
Back to your original question, when you say it breaks the other routes, you mean it puts them intoa query string formatted url? Like <a href="/?controller=admin&action=index"> ? Also, just to give it a shot, move the new :user route you created after the last :controller/:action/:id route. -NSHB On 7/23/06, Greg Donald <gdonald@gmail.com> wrote:> > On 7/23/06, Andrew Stone <stonelists@gmail.com> wrote: > > Can you post your complete routes file? > > ActionController::Routing::Routes.draw do |map| > map.connect '':user'', :controller => ''user'', :action => ''profile'' > map.connect '''', :controller => ''home'' > map.connect '':controller/:action/:id'' > end > > > -- > Greg Donald > http://destiney.com/ > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Kind regards, Nathaniel Brown President & CEO Inimit Innovations Inc. - http://inimit.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060723/3d5f07bb/attachment.html
I think you could do this and it would work: ActionController::Routing::Routes.draw do |map| map.connect '''', :controller => ''home'' map.connect '':controller/:action/:id'' map.connect '':user'', :controller => ''user'', :action => ''profile'' end I''m no routes expert by any means, but I think this may open up some issues for you. If it''s an option, I think it would be best to do something like: http://localhost:3000/profile/username good luck! -- Andrew Stone -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060723/f0b0ece7/attachment.html