Topic: Partial rendering


I'm using rails 3.2.1 and I'm trying to partial render one view to other view div.
I want many controllers to render to that specific div,  so I cant the view to know which controlled will render.

I've tried with the 'replace_html' method but I haven't  succeeded to render one view to another.
I've also tried to set the data-update-target to the specific div it failed.

#VIEW (index.html.erb)
<%= link_to 'click',  {action: 'show_list'}, :remote=> true %>

What my controller should look like if the partial view is 'show'?

Thank you very much! !

Last edited by ericman (2013-06-05 16:25:46)

Re: Partial rendering

You can render no matter which partial in no matter which view as follows:

<%= render "shared/menu" %>

This will render a partial _menu located in views/share folder.
See more details on rendering at Rails Guides.

Re: Partial rendering

Is there any way that the rendering will happen only when the user click on button?