Sharing popover.rhtml among different partials

7 views
Skip to first unread message

Viral

unread,
Oct 8, 2011, 5:02:04 PM10/8/11
to rubyonra...@googlegroups.com
Hello,

I have product page and in that there are different containers (Product description, Owners, etc).. Each container have "edit" button and when user click on edit button, a popover window is open with the content in editable mode (Similar to G+ profile editing). I have code for  popover in shared/_popover.rhtml shown as follow:

<div class='popup'>
<div class='popup-title'>
<a class='popup-close' href='#'>Close<span class='close-button'></span></a>
</div>
<div class='popup-body'>
</
div>
</div>
When Product description is in edit mode....it has title "Edit Description" and body has Product Description in editable mode. However, when I click edit for owners...it will show title for Product Description and in body area it will show Product Description and Owners in editable mode. 

So, Finally I am writing individual popver for different containers. Can anyone guide me how can I re-use above popover code for all the editable container on my page.

PS: on my page every container is  partials (eg product description is partial and owner is partial as well). 
I looked into content_for as well...but it not working as excepted.

For example please go to your Google+ profile and try to edit something....I m trying to achieve same thing.

Thanks
Viral

Reply all
Reply to author
Forward
0 new messages