Tuesday, April 21, 2009

Using Rails scaffolding

A handy tool that comes with Rails is its ability to create fully functional, dynamic Web sites based on the database schema. Knowing that there are standard CRUD operations, scaffolding creates the controllers and helper code you need to make a site work (without all the branding and AJAX, of course...)

A problem I experienced was this error message:

The name 'TasksHelper' is either already used in your application or reserved by Ruby on Rails.

A little Googling revealed that this is a "bug" that appeared in recent Rails releases (I'm currently using v2.2). Here is a link to the most useful post I found. Pay particular attention to the poster who says to rename the helper files. It's kludgy but better than creating all that code manually.

No comments:

Post a Comment