Displaying 19 results from an estimated 19 matches for "cart_items".
Did you mean:
cart_item
2006 Jul 07
5
Can a route require POST or GET? / REST problem with routing
Hi,
A store front a customer wants to GET /product/5/show. But for the
application this is really GET /cart_item/new/5 or even better
/cart_item/new?cart_item[product_id]=5
When the customer clicks add_to_cart they POST /product/5/show so that
the url doesn''t confuse the user when any validation errors occur. But
for the applicaiton this should be POST
2006 Jul 24
1
Newbie error: undefined local variable or method
When I add an item to the shopping cart, I get an error:
undefined local variable or method `cart_item'' for
#<#<Class:0x3715a78>:0x3715a48>
Session info says the cart being updated properly. I''m just not able
to output two variables:
<%= cart_item.quantity %> × <%= h(cart_item.title) %>
I did some research, and I can grasp that local
2006 Jul 18
15
Agile Web Developement with Rails
I recently got a copy of the second addition in PDF
and got stuck on the Ajax portion using highlighting
page 128. While trying to make my cart flash I got an
RJS error when I click add to cart. I have gone back
and made sure my code matched what was in the book but
no help. I sent Dave an email and he rec''d this list.
Anybody got any good links for troubleshooting Ajax or
maybe have see
2006 Jul 03
0
Page 129 of Agile Web Dev on Rails (or pg141 of pdf!)
Hi - another question, sorry....
I''m trying to get the highlighting effect to work on the current_item.
The page refreshes fine, and then I get an error as the highlighting
code is fired:
page[:current_item].visual_effect :highlight,
:startcolor => "#88ff88",
:endcolor => "#114411"
The error
2007 Oct 17
9
@session['user'] vs session[:user]
This might seem really simple to some but just wanted to ask: what is
the difference between @session[''user''] and session[:user] ? and how
would you use each?
And another question, I have the following code:
def get_customer
if @session[''customer'']
@c = Customer.find(@session[''customer''])
end
end
private
def
2006 Jul 10
2
cross controller functional tests?
Hi,
I have an online store and I would like to simulate a complete
shopping trip which involves several controllers? How can I write a
test that calls actions from different controllers in a particular
sequence? Something like the following which involves department,
product, cart_item, and cart controllers.
get department 5
check it has a link to product 4
get product 4
post cartitem/create
get
2010 Oct 11
0
undefined method `includes_values' for :conditions:Symbol
...pp.com/projects/45560-acts-as-ferret/tickets/176-aaf-051-undefined-method-includes_values-for-conditionssymbol#ticket-176-4
Anyway, i fixed the query and moved on.
Today I hit the error again but I do not have any include queries.
It seems that rails is generating it.
I have a cart that has many cart_items and a cart item belongs to a
domain.
When I try to access the domain in my cart view I get the
''includes_values'' error on this item (item.domain.id)
<% @cart.cart_items.each{|item| %>
<li id="cart_domain_id_<%=item.domain.id%>" class="cart-ite...
2007 Oct 18
0
REST help
...trying to build a RESTful shopping cart and I have hit a small
wall, but before I get to that let me explain what I have done thus far.
I have two RESTful controllers, CartController and CartItemsController
with a nested routes setup like so
map.resources :carts do |carts|
carts.resources :cart_items, :collection => {:empty => :delete}
end
(I added a custom route to the for emptying the cart as it seemed to me
that when I clear the cart I am operating on the items which is why I
added that action to the CartItemsController. If this is not RESTfully
"correct" I would love to...
2006 Jul 16
17
AWDWR question
In an early section on Action View, showing code being put directly
into the rhtml file:
<% require ''date''
DAY_NAMES = %w{ Sunday Monday Tuesday Wednesday Thursday Friday Saturday }
today = Date.today %>
<h1>Hello, Dave</h1>
<p>
It''s <%= DAY_NAMES[today.wday] %>.
Tomorrow is <%= DAY_NAMES[(today + 1).wday %>.
</p>
I get this
2008 Oct 24
4
Railscast 75, Observe_field and Shopping Cart
Hi all,
I have the shopping cart page where a user can add items dynamically
through ajax as explained in Railscast episode 75. I am using
observe_field to observe the ''quantity'' and ''cost'' fields to update
the total field for each item.
This does not work however, for records that are added through the
Ajax. How can i name the fields and observe them as i have
2007 Oct 15
4
ArgumentError in StoreController#add_to_cart: wrong number of arguments (1 for 0)
I am really new to Ruby and Rails but as you probably see I am trying
to get the shopping card working from the book. I am getting this
error but I really don''t know what to do. I have looked up several of
topics that stated the same problem but as far as I am, nothing has
helped me out yet. Is there something wrong with the Product model?
This is in the StoreController and I believe it
2006 Feb 27
1
Nested hash from form params into create()?
..."47"}}
}
## CONTROLLER ##
def add_to_cart
CartItem.create(params}
end
## MODELS ##
class CartItem < ActiveRecord::Base
belongs_to :variation
has_many :cart_item_options
end
class CartItemOption < ActiveRecord::Base
belongs_to :cart_item
end
## TABLES ##
CREATE TABLE cart_items (
id SERIAL,
variation_id INTEGER UNSIGNED NOT NULL
);
CREATE TABLE cart_item_options (
id SERIAL,
cart_item_id INTEGER UNSIGNED NOT NULL,
optional_id INTEGER UNSIGNED NOT NULL
);
## ERROR ##
CartItemOptionalVariation expected, got Array
RAILS_ROOT: script/../config/..
Application Tr...
2007 May 30
2
Depot - empty_cart with ajax
First of all id like to say hi to everyone from Argentina, im yet
another Depot first-timer.
Going through the example, i got to the point where my cart finally
runs Ajax-based. And there is a line where Dave says, after all the
job is done "You should see the cart in the sidebar update. And you
shouldn''t see your browser show any indication of reloading the page.
You''ve
2006 Apr 10
4
Many To Many''s Join table attributes + migrations
Hi all,
just joined and have only just kicked off with Rails (coming, but not
departing, from WebObjects development). And so far there seems to be
a lot of promise except for one thing I can''t figure out as yet --
the above problem.
Say I have the following conceptual relationships:
ITEMS <<--->> CARTS
i.e., each item can belong to one or more categories. So really
2006 Aug 04
6
Errors ... errors and errors.
I bought the second edition of the ruby on rails, it seems to work fine
now, did some adjustments to the code. But now I get a second error and
I want to learn to understand to fix them myself. So here is the error.
ArgumentError in StoreController#add_to_cart
wrong number of arguments (1 for 0)
#{RAILS_ROOT}/app/models/cart.rb:15:in `initialize''
#{RAILS_ROOT}/app/models/cart.rb:15:in
2007 Jun 06
0
uninitialized constant Cart::CartItem
I am following a tutorial and get thar error creating a cart, and can''t
figure it out,
uninitialized constant Cart::CartItem
Extracted source (around line #8):
5: <h3>Your Shopping Cart</h3>
6:
7: <ul>
8: <% for item in @cart.cart_items %>
9: <li id="cart_item_<%= item.book.id %>">
10: <%= render :partial => "cart/item", :object => item %>
11: </li>
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this messag...
2007 Jan 12
9
Nil object in E1 capture the order
I''m following the depot application in the rails bible Agile Web
Development with Rails. In interation E1
NoMethodError in Admin#checkout
Showing app/views/admin/checkout.rhtml where line #12 raised:
You have a nil object when you didn''t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.include?
Extracted source (around line #12):
2006 Jul 31
4
RJS to find an element
I''m trying to implement a remove from cart method based on the
examples in the second edition Agile book. I have everything working
except for the RJS that removes items from the cart. Ideally what
I''d like to do is highlight an element that I am deleting only if
there is more than one of that particular item in the cart. If the
item deleted is the only of
2006 Jun 18
13
Currency calculation
I''m thinking of experimenting with some currency conversion. However,
I''d like the conversions to be in synch with the current rates.
Anyone know (and this maybe out in left field) if there is some online
(perhaps xml) or other data stream I can connect with in my code to
output values based on user selection ?
TIA
Stuart