Forum: Ruby on Rails Intermittent problem with link_to_remote()

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.
Joseph Chan (Guest)
on 2006-01-04 14:27
(Received via mailing list)
Hi folks,

My page displays links for 'categories' using the link_to_remote()
function.   Clicking on one of these links goes to the controller and
returns any child categories.    I'm finding that the page works ok but
after a number of clicks (average 5 or so), it crashes with an error:

==============================================
Processing Base#index (for 127.0.0.1 at 2006-01-04 15:26:28) [POST]
  Parameters: {"current_stage"=>"stage_1", "category_id"=>"1"}


ArgumentError (undefined class/module Listing):
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session/active_record_store.rb:84:in
`load'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.11.2/lib/action_controller/session/active_record_store.rb:84:in
`unmarshal'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session/active_record_store.rb:122:in
`data'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.11.2/lib/action_controller/session/active_record_store.rb:129:in
`marshal_data!'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/callbacks.rb:333:in
`send'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-
1.13.2/lib/active_record/callbacks.rb:333:in
`callback'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/callbacks.rb:330:in
`each'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/callbacks.rb:330:in
`callback'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/callbacks.rb:248:in
`create_or_update'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1226:in
`save_without_validation'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2
/lib/active_record/validations.rb:698:in `save_without_transactions'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/transactions.rb:126:in
`save'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/transactions.rb:126:in
`transaction'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/transactions.rb:91:in
`transaction'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/transactions.rb:118:in
`transaction'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/transactions.rb:126:in
`save'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session/active_record_store.rb:300:in
`update'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session/active_record_store.rb:300:in
`silence'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session/active_record_store.rb:300:in
`update'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session/active_record_store.rb:307:in
`close'
    F:/ruby/lib/ruby/1.8/cgi/session.rb:166:in `callback'
    F:/ruby/lib/ruby/1.8/cgi/session.rb:165:in `call'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:833:in
`initialize'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/code_generation.rb:65:in
`new'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/code_generation.rb:65:in
`dup'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/code_generation.rb:96:in
`move_forward'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:201:in
`recognition_check'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:193:in
`method_missing'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/code_generation.rb:46:in
`indent'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/code_generation.rb:46:in
`method_missing'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:193:in
`recognition_check'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:159:in
`write_recognition'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/code_generation.rb:136:in
`go'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:326:in
`write_recognition'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:479:in
`write_recognition'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:477:in
`each'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:583:in
`each'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.11.2/lib/action_controller/routing.rb:477:in
`write_recognition'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:476:in
`method_missing'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.11.2/lib/action_controller/code_generation.rb:46:in
`indent'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/code_generation.rb:46:in
`method_missing'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.11.2/lib/action_controller/routing.rb:476:in
`write_recognition'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:578:in
`draw'
    /config/routes.rb:1
    F:/ruby/lib/ruby/gems/1.8/gems/activesupport-
1.2.5/lib/active_support/dependencies.rb:207:in
`load'
    F:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:207:in
`load'
    F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:555:in
`reload'
    F:/ruby/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:69:in
`prepare_application'
    F:/ruby/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:37:in
`dispatch'
    F:/ruby/lib/ruby/gems/1.8/gems/rails-
1.0.0/lib/fcgi_handler.rb:141:in
`process_request'
    F:/ruby/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:53:in
`process!'
    F:/ruby/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in
`each_cgi'
    F:/ruby/lib/ruby/site_ruby/1.8/fcgi.rb:595:in `each'
    F:/ruby/lib/ruby/site_ruby/1.8/fcgi.rb:595:in `each_cgi'
    F:/ruby/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in
`process!'
    F:/ruby/lib/ruby/gems/1.8/gems/rails-
1.0.0/lib/fcgi_handler.rb:22:in
`process!'
    F:/web/whooshi/public/dispatch.fcgi:24
==============================================

Can anyone shed light on this?    I'm running Apache2+fastcgi under
Windows
XP with Rails 1.0.

Thanks,

Joe
Mark Reginald J. (Guest)
on 2006-01-04 23:49
(Received via mailing list)
Joseph Chan wrote:

>
> ArgumentError (undefined class/module Listing):
>
> 
F:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session/active_record_store.rb:84:in
> `load'

If you are storing Listing objects in your session, rather than just
their
ids, you need a "model :listing" call at the top of your controller.

--
We develop, watch us RoR, in numbers too big to ignore.
Joseph Chan (Guest)
on 2006-01-05 02:54
(Received via mailing list)
Thanks Mark - that fixed the problem!
This topic is locked and can not be replied to.