I have a view working on the following code:-
<% @products.each do |office| %> <div class="item"> <%= image_tag(office.image_url) %> <p><strong><%= office.item_code%></strong> </br><em><%= truncate(office.title, length: 18) %></em></p> <p class="showArticle"><%= link_to 'Show Article', office %></p> <p class="addTo"><a href="#">Quote this item</a></p> </div> <% end %>
The above is in the 'Store' view and calls on the records held in the 'Product' table and renders them each in turn here. I have a link_to helper, 'Show Article' that upon click is supposed to replace the <div class="item"> content with the content of that one item. Instead the browser is redirected to the 'Show' page for that item within the 'Products' section of the app.
Can anyone offer me any pointers in how i render a new view within this location? I was hoping for a technique that will carry the items information over to a new view that would allow me to choose the information from that item i want presented to the user and styled in the way i want it styled.
Any help given is much appreciated.