search for: cartcontroller

Displaying 6 results from an estimated 6 matches for "cartcontroller".

2007 Jan 05
4
How To Spec Controllers with Finders
Given this code (which renders rjs), I''m faced with the fixture- driven way of spec-ing or mocking. How the heck to you mock this so the code at line (2) and (4) work right? I''m still struggling with mocks but it seems like this can be done. Forgive the naivety of this question. 1. def change_quantity 2. @line_item = LineItem.find_by_id(params[:id]) 3. unless
2008 Oct 28
5
Page does not seem to be reloaded on prod server
Hi all I''ve coded a small shop that works well on my dev machine (OSX 10.5). But look at the following page: http://shop.incense.ch/compact_discs/1 When clicking "Reservieren", the page is forwarded to a new page, where the product is added to the shopping cart, and a flash notice is prepare. Then the page is redirected back to the shop page. On my dev machine this works
2006 May 24
22
Components going out of style?
I see in the new Agile Rails 2nd edition that components are going out of style? Is this so? has anybody abandoned the idea of components for helpers? Specifically I''m considering a menu sytem for a website that depends heavily on the users permissions to decide which menu options a user would need to see. I thought that components, since they have the logic in the controller and
2006 Jul 05
0
Different log file per controller
Is there a way to specify a different log file for requests to a specific controller? For example, all requests to CartController would get logged to cart.log. Thanks in advance. Jean-Francois Couture -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060705/b4da199c/attachment.html
2007 Oct 18
0
REST help
Hi all, I am 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 ite...
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