I have recently taken the habit of checking on Rails forum from time to time whether there are unanswered questions I can help with. The best way to see a problem in its context is to recreate it and I was amazed by how easy it is to set up a rails site and debug e.g a routing problem.


> rails railsforum_help_routing
> createdb railsforum_help_routing_development
(edit database.yml to set user and possibly database type)
> script/generate model Trip
> script/generate controller Trip
(edit routes.rb, in this case)

Naturally the fact that all this takes about 5 minutes greatly leverages lending a hand to a fellow developer. Now that’s what I call agile!


Rss Comments

1 Comment

  1. Szia Balint ;-)

    Actually you can (and in this case, should - since you want to create a resource) reduce the last 3 lines to one:

    script/generate resource Trip

    this will generate the model, the controller (and all the other shit like tests) as well as adding map.resources :trips to your routes.rb

    #1 Peter

Leave a comment