one-to-many associations made easy with ActiveScaffold
I just dove in and started using ActiveScaffold for a new project. There was a little learning curve since I was doing that along with using RESTful Rails. I just started with a simple 1-many association. I setup my 2 models as usual with has_many :ads and belongs_to :affiliate. Then I created two controllers that just had something like:
And finally added this to my routes:
When I went to http://localhost:3000/affiliate I was just amazed to see it actually worked. It let me create my affiliate and add ads to that affilaite on the fly. All my crud operations already done without having to manually link them in the controller like I had been doing in previous projects. I’m not sure how well its going to scale with the project in the long run but it certainly is an improvement over the traditional Rails scaffolding and I highly recommend giving it a try.

September 24th, 2007 at 11:25 am
I love rails and activescaffold. I was using it to make a little web app to manage samples in the lab. It really did make things pretty easy and was a lot prettier to the the traditional rails scaffolding.