Ruby on Rails

If anyone reading this happens to have used Rails at any point (unlikely, I know, since it's only been out for about two months, and by-and-large the readers of this blog are less geeky than I, but there are some odd sorts lurking and one never knows...), I have a query:

Suppose I use Rails to auto-generate all manner of web application goodness, and I hack on that generated code a bit to make something passably pretty. If I subsequently realise that I naffed up the database schema, do the tools neatly integrate the changes, or do I end up with a tangled mess?

Please answer in small words, typing very slowly, as if to a small child.

1 Comment

Rails is not a code generation framework in the static sense where a ton of files are created on the file system to edit. Instead, Rails uses run-time code generation on the classes and objects as they come to life.

This means that when you write x amount of code, you get perhaps 3x back. If you change the original x, the “generated” code will adapt automatically.

So no, you will not get a tangled mess. You will have far less code than most frameworks allow you to get away with. And since you have a smaller codebase, it’s much more agile and acceptable to change.

Database changes is something that Rails is particularly well-adapted to handle. This is so because unlike meta-data based frameworks, you don’t need to describe the mapping between classes and tables. Active Record (part of Rails) will figure that out for you. Hence, it will automatically adapt when you add or remove a field.

Hope that made it some what clear ;)

Leave a comment

About Jonathan

Lapsed: physicist and television producer. Now: media consultant/freelance film-maker, trying to reignite public-service children's media, particularly around science and engineering.

Categories

Recent Entries

  • Internet Watch Foundation filtering

    Lots of talk on Twitter today about [this](http://en.wikinews.org/wiki/UK_ISPs_erect_%27Great_Firewall_of_Britain%27_to_censor_Wikipedia): six major UK ISPs (including mine, the previously-rather lovely [Be](https://www.bethere.co.uk/)/O2, also Orange, Virgin, Demon, EasyNet, PlusNet and...

  • Building buzz without a budget

    Here's an excellent, [short presentation from the Nature Conservancy](http://www.slideshare.net/jcolman/building-buzz-without-a-budget-presentation?nocache=5510&type=powerpoint), outlining their use of Digg to drive traffic to a new website they were promoting. I...

  • The supercomputer in your web browser

    Computational Fluid Dynamics... [in Flash](http://www.joecutting.com/windTunnel.php). This is plain *wrong*, I tell you....

  • Things to know about the Panasonic HMC150/1

    I finally succumbed, and bought a proper camera. A video camera, none of your stills nonsense, nor yet a [stills camera masquerading as a video...

  • Alexandria Railway Station is in Dalaman, Turkey.

    Quoth [Wikipedia](http://en.wikipedia.org/wiki/Dalaman): > In 1906, Alexandria train station was built by mistake in Dalaman. ... In 1905 the then Khedive of Egypt Abbas Hilmi Pasha...

Close