Forum: Ruby on Rails Ajax_generator as a component for master/detail use?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Greg F. (Guest)
on 2006-03-15 03:34
(Received via mailing list)
I'm experimenting with the Ajax Generator for the first time and I'm
trying to setup a master/detail edit page.

My goal is to display both the Master info and the detail records on a
single page.  And allow detail records to be created/edited/deleted on
the fly.

Not sure its possible, but that's what I'm trying to do.

=== Details

I have an existing master table of clients.

I've just created a detail table of todos.  (Plural of todo).

I've used the "script/generate ajax_scaffold todo" to create a basic
todos MVC set.

Note the plural todos. For some reason the ajax generator created
files with the plural name.

I now want to edit my master table's edit view to have it incorporate
the detail records.

As a newbie I'm guessing that I should add

<div id="todo_list">
<%= render_component :controller => "todos" %>

This sort of works.

A blank detail record area is being rendered at the bottom of the
master edit screen and when I click on "new" ajax pops up a new blank
detail record.  Even better if I have a detail record in the database
it is rendered properly.  (Rendered on all master edit pages, but this
is a very good start.)

The first trouble is that when I try to create a new detail record the
master edit form goes away and the master show page is displayed.  The
detail record itself is not being saved.

Am I headed in the right direction, and if so what do I need to do?

Greg F.
The Norcross Group
Forensics for the 21st Century
This topic is locked and can not be replied to.