Topic: Calling partial of another view


I am very new to ruby on rails and I am facing little problem with
I have two controller product and items. In product view, I have a
partial called _show.html.erb. And in items view, i call index of item
to display all products. The problem is, when user clicks on the
image_tag of the items view, i want to call partial of product view i.e

here is the view code:
<%@products.each do |product|%>
  <div class="entry">
    <%=link_to image_tag(product.image_url)%> #"I want to call a partial here"

Please help me


Last edited by MohanatRails (2012-04-23 12:50:19)

Re: Calling partial of another view

you post is truncated.
This will render a file named _menu.html.erb at that point within the view being rendered.

<%= render "menu" %>

That code will pull in the partial from app/views/shared/_menu.html.erb.

<%= render "shared/menu" %>

Re: Calling partial of another view

Thanks for sharing time for this problem. Updated issue for clarification.