Quantcast
Channel: Pragmatic Forums | Posts by Tan YL
Viewing all articles
Browse latest Browse all 19

highlight effect posted by Tan YL @ Thu, 04 Sep 2008 07:40:48 +0000

$
0
0

sgpanel.html.erb:

< ul class=”panes” id=”panecontrol1”>
< li id=”vendor_pane” class=”pane-selected”>

< div id=”calculator”>
<= render :partial => ‘calculator’, :id=> @sguser.id, :object => {@item,@lineprice}>
< /div>

< /li>
< li id="part_pane" class="pane-unselected">
< /li>
< li id="map_pane" class="pane-unselected">
< /li>
< li id="notes_pane" class="pane-unselected">
< /li>
< ul>

_add_to_cart.html.erb:
<table>
<% for product in @lineprice %>

<% if product.groceries.id == @item.groceries_id %>
   <tr id="highlighted"><% else %>
   <tr><% end %>
      <td><%= product.groceries.brand %></td><td><%= product.groceries.name %></td><td><%= product.quantity %></td><td><= qx(product,"c") %>< totalC += qx(product,"c")%></td><td><= qx(product,"n") %>< totalN += qx(product,"n") %></td><td><= qx(product,"s") %>< totalS += qx(product,"s") %></td><td><= qx(product,"g") %>< totalG += qx(product,"g") %></td><td><= qx(product,"ca") %>< totalCa += qx(product,"c") %></td><td>item:<= @item.groceries_id>Product:<%= product.groceries.id %></td><td><= cheapest=product.groceries.supermarket.attributes.except('id', 'groceries_id','created_at','updated_at').values.min %> <= Groceries.namecompare2(product) >< totalCh += cheapest %></td></tr><% end %>
<table>
-------------------------

add_to_cart contains the full replacement but the weird thing is that i need to refresh the whole page to see the new product. It just doesn’t make sense. I am nearly doing the same things that u are doing in depot except using mysql instead of a session to store data


Viewing all articles
Browse latest Browse all 19

Trending Articles