Forum: Ruby how to declare model classes in Application.rb

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Vikas G. (Guest)
on 2008-12-29 08:20
Hello all,
I am new to ruby development.
I created a simple online book store Application.
 but when i select book & click on 'add to cart' it gives me error

"undefined method `model' for ApplicationController:Class"

class ApplicationController < ActionController::Base

  model :cart
  model :line_item

end

cart & line_item are two model classes.
I am storing the model cart in session
I'm using rails 2.2 version
So what's going wrong?
please help me to solve this problem.


Vikas
Ryan D. (Guest)
on 2008-12-29 09:53
(Received via mailing list)
On Dec 28, 2008, at 22:20 , Vikas G. wrote:

> Hello all,
> I am new to ruby development.
> I created a simple online book store Application.
> but when i select book & click on 'add to cart' it gives me error

please ask these questions on the ruby on rails mailing list.
This topic is locked and can not be replied to.