That’ll make your URLs work as long as you’re always passing the @trader object around. However, you have to change all of your finders now to look up by name
So, instead of
@trader = Trader.find(params[:id])
You must do
@trader = Trader.find_by_name(params[:id])
Repeat for the user model and controllers.
If you’re just starting out, don’t mess with this now. Learn how routing and finders actually work. You may discover a better way too. The ids don’t hurt anything and are much less volatile. If you change the trader’s name for example, the link is no longer valid.
Also, scaffolding isn’t meant for production. The URL stuff you’re trying to do is infinitely easier to do if you don’t use scaffolding. That’s why I say don’t tackle this now, wait until you understand how everything works together. Once you get it, these types of URLs become trivial because you’re WRITING the finders yourself, instead of changing a bunch that were originally intended to work a different way.
I am currently learning by playing around with the scaffolds. Do you
have certain resources to point me to? Bear in mind, I am pretty damn
noob.
Also, scaffolding isn't meant for production.
Oh no, I want to do one for a very simple game for production. If I
dont use scaffold, i may be lost. Even if i code from scratch, i will
inevitably copy teh code from scaffold.
I do have the eBook of Agile Devt with Rails and a few other Rails
eBook. But sometimes I feel the examples they use are a tad too
simple. Furthermore, i intend to use make a more Restful application.