Phillip , my inventory_controller.rb:
class InventoryController < ApplicationController
def index
@albums=Album.find(:all)
@cart=find_cart
end
def add_to_cart
itemType=params[:itemType]
productId=(params[:id]) #parameter passed in from "add to
cart" s
All,
I put the before_filter in my inventory_controller and it worked...didn't
see that it doesn't belong in the Cart.rb file. Thanks for the help!
Cheers
Jon
On Sun, Sep 28, 2008 at 4:03 PM, Jon Liu <[EMAIL PROTECTED]> wrote:
> Heinbull,
>
> I tried to use the before_filter in my Cart Model.
Heinbull,
I tried to use the before_filter in my Cart Model...mind you it's not an
actual sql table, it's just a class I created. From looking at reference
tools it looks like before_filter is usually used for actualy table
models but I tried it any way and I got the error "undefined method
b
>From experience I would use a before_filter to load the cart for you
controller...
Something like:
before_filter :initialize_cart
private
def initialize_cart
if session[:cart_id]
@cart = Cart.find(session[:cart_id])
else
@cart = Cart.create
session[:cart_id] = @c
Jon wrote:
> in my controller inventory_Controller I have a variable called @cart
> that is set to @cart=find_cart in the beginning of each method. The
> cart is displayed on the left hand sidemenu, so each page like
> inventory/review, inventory/dvd inventory/checkout has to have @cart
> defined
Have you tried map.resources :main?
On Sep 21, 10:50 pm, Grayson Piercee <[EMAIL PROTECTED]
s.net> wrote:
> Ryan Bigg wrote:
> > How are you mapping it in the routes.rb?
>
> map.resource :main
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You
Ryan Bigg wrote:
> How are you mapping it in the routes.rb?
map.resource :main
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to thi
How are you mapping it in the routes.rb?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this gr
the usual index, create, update, destroy; whatever generate controller
does by default.
Bobnation wrote:
> What methods do you have in your MainsController?
>
> On Sep 18, 12:58�pm, Grayson Piercee <[EMAIL PROTECTED]
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~-
What methods do you have in your MainsController?
On Sep 18, 12:58 pm, Grayson Piercee <[EMAIL PROTECTED]
s.net> wrote:
> I have a controller named main and it's mapped through routes.rb
>
> when I link to "main_path" I get this error:
>
> uninitialized constant MainsController
>
> I tried creati
10 matches
Mail list logo