Rails Routing Question: Mapping Slugs/Permalinks Directly under Root? -


Everybody in the morning! ..

The usual routing Quesiton is here ... I am currently working to get the users in my application have a route like this.

Username

This is then a map to show the user controller #, so I have the following in the root file.

map.connect '/: permalink' ,: Controller => "user" ,: action => "show"

To show up on Perlin is the show's action. So its works but ....

The problem I am running is that all other unsaved users are sent to the controller # that is, 404 & amp; nbsp; Other non-designated routes, therefore, I do not think that I am going with the right conference for this. My solution is just to add another named path above it, which solves the problem, but I feel brittle, am I thinking about this wrong idea?

Is there a better solution? I'm going to Google for a reply, but I thought I'd throw it away for discussion?

You're correcting it. Rail routes are known to be less priority than the high priority below. Your users show that the action should go down. Just make sure that if the user does not have the merchant according to the permalink, then the appropriate 404 is generated


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -