# Hiding \<div\> tag thru an action event

**URL:** <https://www.ruby-forum.com/t/hiding-div-tag-thru-an-action-event/87505>\
**Category:** Rails\
**Created:** [March 3, 2007, 4:45am UTC](https://www.ruby-forum.com/t/hiding-div-tag-thru-an-action-event/87505 "2007-03-03T04:45:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wcheung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ee59a6/32.png) [@wcheung](https://www.ruby-forum.com/u/wcheung)\
**Post date:** [March 3, 2007, 4:45am UTC](https://www.ruby-forum.com/t/hiding-div-tag-thru-an-action-event/87505/1 "2007-03-03T04:45:09Z")

</div>

Hi,

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  
user  
clicks on ‘edit’ or ‘new’ on the top half list.

Now, when the page loads normally, I want to display just the list  
(no  
forms on the bottom). When I click on ‘edit’ one of the list entry  
on  
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  
this:

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

Thanks in advance.
