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!