[OT] Ajax design question - breaking a table with text

Hello everyone,

I’ve got a table of data that looks like the following:

Field 1 Field 2 <%= link_to "Info about Field 1", ... %> <%= link_to "Info about Field 2", ... %>

I’d like the user to be able to click on “Info about Field 1”, and
have a block of info appear between this

and the next . The
following record would move down, and the “Info about Field 1 content”
would be inserted between the two records.

The only way I can think of doing this is to insert an empty immediately following

, then load the
following into it when the user clicks on “Info about Field 1”:

Here's lots of exciting info about Field 1

...

In other words, close off this table, insert a paragraph of text, then
start a new table to hold the content of all following rows. While I
think I can get this looking good onscreen, the code looks UGLY - I’ve
broken up a single table into two, separated by a bunch of text. The
code would look like:

... ...
...
...

Here's lots of exciting info about Field 1

...
...

Is there a better approach generically for this sort of situation?
I’m sure this is probably Web Dev 101 stuff these days, but I never
made it to the classroom!

Thanks in advance

Dave M.

On Sunday, July 23, 2006, at 9:17 PM, David M. wrote:

Dave M. _______________________________________________ Rails mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails

If it would work, I would insert this below the current line…

I have a feeling that this won’t work well, there are issues with
replacing table elements in some browsers (like IE).

_Kevin
www.sciwerks.com

... ...
Text block with info

With your table, ensure that you have the proper tag around all

elements. Have the links within each of the TR's that should display the info below have an id like so
link for info with id... link for info with id...
link for info with id... link for info with id...

And you should be able to use RJS like so…

page.insert_html :bottom, params[:row], render(:partial =>
‘rowHelpInfo’)

FYI: I got that working on IE as well.

-NSHB

On 23 Jul 2006 14:16:19 -0000, Kevin O. <
[email protected]> wrote:

<%= link_to "Info about Field 1", ... %> following into it when the user clicks on "Info about Field 1": code would look like:

Here's lots of exciting info about Field 1

Posted with http://DevLists.com. Sign up and save your mailbox.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Kind regards,

Nathaniel B.
President & CEO
Inimit Innovations Inc. - http://inimit.com