Forum: Ruby on Rails Hiding <div> tag thru an action event

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.
76c0ba00aeb7b0951cb705f157a1b119?d=identicon&s=25 wcheung (Guest)
on 2007-03-03 04:45
(Received via mailing list)

I'm having a hard time figuring this one out - hopefully somebody can
shed some light on this.

I have a page with top half consisting a partial of the scaffold list
page, and bottom with another partial of a form, depending if the
clicks on 'edit' or 'new' on the top half list.

Now, when the page loads normally, I want to display just the list
forms on the bottom).  When I click on 'edit' one of the list entry
top, I want to display an 'edit' form for that entry.  After clicking
update button, the form disappears and updates the list.  I want to
same behavior with 'new' as well.

Note that this is only one page, so any action is involved will be
directed back to this page.  Is there something in Rails that will
specify which action event has occurred?  If so, I can put it like

<% if (edit) %>
   <% edit form %>
<% elsif (new) %>
  <% new form %>
<% end %>

Thanks in advance.
This topic is locked and can not be replied to.