Displaying 11 results from an estimated 11 matches for "addtocart".
Did you mean:
add_to_cart
2006 Jan 20
5
Instance variable?
I''m trying to grab a temporary variable from my view and then pass along
that value to my model
My view code is this:
<td width="40" align="center"><%= text_field ''product'', ''qty_added'',
{:size=>3}
And I''m trying to pass the qty_added variable to my model.
item.quantity = qty_added
It doesn''t seem
2006 Jan 13
2
Problem
...torial from the Thomas~Hansson book and am getting this
error message:
Extracted source (around line #17):
14: <%= link_to ''Add to Cart'',
15: {:action => ''add_to_cart'',
16: :id => product },
17: class => ''addtocart'' %>
18: </br>
19: </td>
20: </tr>
Trace of template inclusion: /app/views/store/index.rhtml
I''ve compared what I have with the book and they seem the same. I''m
thinking that either I''m missing something (very possible) or maybe the...
2005 Dec 19
1
<% unless params[:context] == :gallery -%> question
...ce"><%= @products[0].price %></span><br
/>
<span id="cart_link"> <%= link_to ''Add to Cart'',
{:action => ''add_to_cart'', :id => product },
:class => ''addtocart'' %><br/>
</span>
<% end -%>
--
Posted via http://www.ruby-forum.com/.
2006 Aug 07
2
Newbie question about adding product to cart
Hello. I''m using the Agile Web Dev. book 1st Edition and I''m puzzled by
the code on pp. 83-84.
<%= link_to ''Add to Cart'', {:action => ''add_to_cart'', :id => product },
:class => ''addtocart'' %>
def add_to_cart
product = Product.find(params[:id])
@cart = find_cart
@cart.add_product(product)
redirect_to(:action => ''display_cart'')
end
In the link_to code, why isn''t :id set to product.id? In other words,
shouldn''t...
2006 Mar 29
0
css, div-tags and ajax
...ied parts of the ajax-examples in Agile Rails prog. and modified
it so it searched for zip-codes. The result is displayed in
search.rhtml. The first version looked like this, I liked the look of
the "add to cart" in the depot-example. :class => ''button1'' is
originally addtocart which I renamed in the .css-file.
<% for city in @cities %>
<%= link_to (city.postalcode,
:action => ''observer'',
:class => ''button1'') %>
<%=h city.name %>
<% end %>
Fairly t...
2005 Dec 24
2
Common menu
Hi,
I''m releasing my first rails application and I''d like to have a common
menu in all my templates.
Do I have to include an rhtml from .rb or other rhtml ? Some sample code pls
?
Regards,
Fabian
2006 May 05
1
Agile Rails (1st edition), depot TDD "exercise"
...n %>
<span class="catalogprice"><%= fmt_dollars(product.price) %></
span>
<%= link_to ''Add to Cart'',
{:action => ''add_to_cart'', :id => product },
:class => ''addtocart'' %><br/>
</div>
<div class="separator"> </div>
<% end %>
</div>
<%= link_to "Show my cart", :action => "display_cart" %>
5. Change the test so it does "assert_template ''search/searc...
2006 Apr 11
2
Extending Depot Example
Hi
I am new to the whole Rails/Ruby world as having come from a MS .NET
background, but I have followed the Depot example in the Agile Web Dev.
with Rails book with relative ease. However as an exercise to see how
much I had understood, I thought I would attempt to modify the example a
bit and add a Quantity field to the store index so as to pass that value
into the cart. I have extended the
2006 May 06
1
depot test-driven development exercise
...n %>
<span class="catalogprice"><%= fmt_dollars(product.price) %></
span>
<%= link_to ''Add to Cart'',
{:action => ''add_to_cart'', :id => product },
:class => ''addtocart'' %><br/>
</div>
<div class="separator"> </div>
<% end %>
</div>
<%= link_to "Show my cart", :action => "display_cart" %>
5. Change the test so it does "assert_template ''search/searc...
2006 Apr 08
16
International characters
I am new to Ruby on Rails. I have read a lot, and bought several books,
and now I have started to implement a modified "shopping cart",
following the AWDWR-book, with modifications to suit our application
(subscriptions and memberships).
Having done up to chapter 7 I have had no real problems, except one:
Since our customers are Swedish I need the screen names, texts etc to be
in
2006 May 06
0
RE: Rails Digest, Vol 20, Issue 156
...n %>
<span class="catalogprice"><%= fmt_dollars(product.price) %></
span>
<%= link_to ''Add to Cart'',
{:action => ''add_to_cart'', :id => product },
:class => ''addtocart'' %><br/>
</div>
<div class="separator"> </div>
<% end %>
</div>
<%= link_to "Show my cart", :action => "display_cart" %>
5. Change the test so it does "assert_template ''search/searc...