Frank Kim
2005-May-11 15:41 UTC
problem w/ login generator: logging in causes problems w/ another controller
I have a User model and a Photo model. The User can have many Photos. I can work with the Photo model w/o problems, for example going to /photo/new. However when I login using /user/login, afterwards I can no longer access any /photo/ URL''s. I always see this problem and have no idea why. Can anyone help me? #<ActionController::SessionRestoreError: Session contained objects where the class definition wasn''t available. Remember to require classes for all objects kept in the session. The session has been deleted. (Original exception: undefined class/module User [ArgumentError])> ["c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/cgi_process.rb:90:in `session''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/base.rb:689:in `assign_shortcuts''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/base.rb:326:in `process''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/rescue.rb:20:in `process_with_exception''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/dispatcher.rb:34:in `dispatch''", "C:/devel/web/mkrb.salted.login/public/dispatch.rb:10", "c:/devel/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/dependencies.rb:189:in `load''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/dependencies.rb:189:in `load''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/webrick_server.rb:82:in `handle_dispatch''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/webrick_server.rb:35:in `service''", "c:/devel/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service''", "c:/devel/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread''", "c:/devel/ruby/lib/ruby/ 1.8/webrick/server.rb:94:in `start''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/webrick_server.rb:21:in `dispatch''", "script/server:48"] [2005-05-11 11:34:07] ERROR `/photo/new'' not found.
Francisco Hernandez
2005-May-11 16:12 UTC
Re: problem w/ login generator: logging in causes problems w/ another controller
the error message explains what to do: Session contained objects where the class definition wasn''t available. Remember to require classes for all objects kept in the session. The session has been deleted. try putting: model :user in your controller to have those dependencies required for you Frank Kim wrote:>I have a User model and a Photo model. The User can have many Photos. > >I can work with the Photo model w/o problems, for example going to >/photo/new. However when I login using /user/login, afterwards I can >no longer access any /photo/ URL''s. I always see this problem and >have no idea why. Can anyone help me? > >#<ActionController::SessionRestoreError: Session contained objects >where the class definition wasn''t available. Remember to require >classes for all objects kept in the session. The session has been >deleted. (Original exception: undefined class/module User >[ArgumentError])> >["c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/cgi_process.rb:90:in >`session''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/base.rb:689:in >`assign_shortcuts''", >"c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/base.rb:326:in >`process''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/rescue.rb:20:in >`process_with_exception''", >"c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/dispatcher.rb:34:in >`dispatch''", "C:/devel/web/mkrb.salted.login/public/dispatch.rb:10", >"c:/devel/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/dependencies.rb:189:in >`load''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/dependencies.rb:189:in > `load''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/webrick_server.rb:82:in >`handle_dispatch''", >"c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/webrick_server.rb:35:in >`service''", "c:/devel/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in >`service''", "c:/devel/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in >`run''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:155:in >`start_thread''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:144:in >`start''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:144:in >`start_thread''", "c:/devel/ruby/lib/ruby/ >1.8/webrick/server.rb:94:in `start''", >"c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each''", >"c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start''", >"c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start''", >"c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start''", >"c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/webrick_server.rb:21:in >`dispatch''", "script/server:48"] >[2005-05-11 11:34:07] ERROR `/photo/new'' not found. >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > >
Sam Newman
2005-May-11 16:50 UTC
Re: problem w/ login generator: logging in causes problems w/ another controller
I hit the same thing - this should really be in the login generator readme though - I let Joe know so I''m sure he''ll put it in the readme for the next version. On 5/11/05, Francisco Hernandez <lagcisco-b7MHZcQsHeJWk0Htik3J/w@public.gmane.org> wrote:> the error message explains what to do: > > Session contained objects > where the class definition wasn''t available. Remember to require > classes for all objects kept in the session. The session has been > deleted. > > try putting: > model :user > > in your controller to have those dependencies required for you > > Frank Kim wrote: > > >I have a User model and a Photo model. The User can have many Photos. > > > >I can work with the Photo model w/o problems, for example going to > >/photo/new. However when I login using /user/login, afterwards I can > >no longer access any /photo/ URL''s. I always see this problem and > >have no idea why. Can anyone help me? > > > >#<ActionController::SessionRestoreError: Session contained objects > >where the class definition wasn''t available. Remember to require > >classes for all objects kept in the session. The session has been > >deleted. (Original exception: undefined class/module User > >[ArgumentError])> > >["c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/cgi_process.rb:90:in > >`session''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/base.rb:689:in > >`assign_shortcuts''", > >"c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/base.rb:326:in > >`process''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/rescue.rb:20:in > >`process_with_exception''", > >"c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/dispatcher.rb:34:in > >`dispatch''", "C:/devel/web/mkrb.salted.login/public/dispatch.rb:10", > >"c:/devel/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/dependencies.rb:189:in > >`load''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/dependencies.rb:189:in > > `load''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/webrick_server.rb:82:in > >`handle_dispatch''", > >"c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/webrick_server.rb:35:in > >`service''", "c:/devel/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in > >`service''", "c:/devel/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in > >`run''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:155:in > >`start_thread''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:144:in > >`start''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:144:in > >`start_thread''", "c:/devel/ruby/lib/ruby/ > >1.8/webrick/server.rb:94:in `start''", > >"c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each''", > >"c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start''", > >"c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start''", > >"c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start''", > >"c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/webrick_server.rb:21:in > >`dispatch''", "script/server:48"] > >[2005-05-11 11:34:07] ERROR `/photo/new'' not found. > >_______________________________________________ > >Rails mailing list > >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- sam http://www.magpiebrain.com/
Joseph Hosteny
2005-May-11 17:03 UTC
Re: problem w/ login generator: logging in causes problems w/ another controller
Yes, I will release a 1.0.8 later today with some more README comments as well as two generator fixes (it was hardcoding to ''user'' in two instances). Frank, I apologize for forgetting this - Sam did tell me and I simply forgot that the lack of the model statement could cause what you were seeing. Joe On May 11, 2005, at 12:50 PM, Sam Newman wrote:> I hit the same thing - this should really be in the login generator > readme though - I let Joe know so I''m sure he''ll put it in the readme > for the next version. > > On 5/11/05, Francisco Hernandez <lagcisco-b7MHZcQsHeJWk0Htik3J/w@public.gmane.org> wrote: > >> the error message explains what to do: >> >> Session contained objects >> where the class definition wasn''t available. Remember to require >> classes for all objects kept in the session. The session has been >> deleted. >> >> try putting: >> model :user >> >> in your controller to have those dependencies required for you >> >> Frank Kim wrote: >> >> >>> I have a User model and a Photo model. The User can have many >>> Photos. >>> >>> I can work with the Photo model w/o problems, for example going to >>> /photo/new. However when I login using /user/login, afterwards I >>> can >>> no longer access any /photo/ URL''s. I always see this problem and >>> have no idea why. Can anyone help me? >>> >>> #<ActionController::SessionRestoreError: Session contained objects >>> where the class definition wasn''t available. Remember to require >>> classes for all objects kept in the session. The session has been >>> deleted. (Original exception: undefined class/module User >>> [ArgumentError])> >>> ["c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/ >>> action_controller/cgi_process.rb:90:in >>> `session''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/ >>> actionpack-1.8.1/lib/action_controller/base.rb:689:in >>> `assign_shortcuts''", >>> "c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/ >>> action_controller/base.rb:326:in >>> `process''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/ >>> actionpack-1.8.1/lib/action_controller/rescue.rb:20:in >>> `process_with_exception''", >>> "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/ >>> dispatcher.rb:34:in >>> `dispatch''", "C:/devel/web/mkrb.salted.login/public/dispatch.rb:10", >>> "c:/devel/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/ >>> active_support/dependencies.rb:189:in >>> `load''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/ >>> activesupport-1.0.4/lib/active_support/dependencies.rb:189:in >>> `load''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/ >>> webrick_server.rb:82:in >>> `handle_dispatch''", >>> "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/ >>> webrick_server.rb:35:in >>> `service''", "c:/devel/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in >>> `service''", "c:/devel/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in >>> `run''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:155:in >>> `start_thread''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb: >>> 144:in >>> `start''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:144:in >>> `start_thread''", "c:/devel/ruby/lib/ruby/ >>> 1.8/webrick/server.rb:94:in `start''", >>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each''", >>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start''", >>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start''", >>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start''", >>> "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/ >>> webrick_server.rb:21:in >>> `dispatch''", "script/server:48"] >>> [2005-05-11 11:34:07] ERROR `/photo/new'' not found. >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >>> >>> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > > -- > sam > http://www.magpiebrain.com/ > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Pat Maddox
2005-May-11 17:15 UTC
Re: problem w/ login generator: logging in causes problems w/ another controller
The readme does discuss this. I''ve been using it for over a month, so
it surely isn''t a brand new copy of the readme:
"It should look something like this :
require_dependency "login_system"
class ApplicationController < ActionController::Base
include LoginSystem
model :user
...
The model :user is required when you are hitting problems to the degree of
"Session could not be restored becuase not all items in it are known"
On 5/11/05, Joseph Hosteny <jhosteny-ee4meeAH724@public.gmane.org>
wrote:> Yes, I will release a 1.0.8 later today with some more README
> comments as well as two generator fixes (it was hardcoding to
''user''
> in two instances).
>
> Frank, I apologize for forgetting this - Sam did tell me and I simply
> forgot that the lack of the model statement could cause what you were
> seeing.
>
> Joe
>
>
> On May 11, 2005, at 12:50 PM, Sam Newman wrote:
>
> > I hit the same thing - this should really be in the login generator
> > readme though - I let Joe know so I''m sure he''ll put
it in the readme
> > for the next version.
> >
> > On 5/11/05, Francisco Hernandez
<lagcisco-b7MHZcQsHeJWk0Htik3J/w@public.gmane.org> wrote:
> >
> >> the error message explains what to do:
> >>
> >> Session contained objects
> >> where the class definition wasn''t available. Remember to
require
> >> classes for all objects kept in the session. The session has been
> >> deleted.
> >>
> >> try putting:
> >> model :user
> >>
> >> in your controller to have those dependencies required for you
> >>
> >> Frank Kim wrote:
> >>
> >>
> >>> I have a User model and a Photo model. The User can have many
> >>> Photos.
> >>>
> >>> I can work with the Photo model w/o problems, for example
going to
> >>> /photo/new. However when I login using /user/login,
afterwards I
> >>> can
> >>> no longer access any /photo/ URL''s. I always see
this problem and
> >>> have no idea why. Can anyone help me?
> >>>
> >>> #<ActionController::SessionRestoreError: Session contained
objects
> >>> where the class definition wasn''t available. Remember
to require
> >>> classes for all objects kept in the session. The session has
been
> >>> deleted. (Original exception: undefined class/module User
> >>> [ArgumentError])>
> >>>
["c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/
> >>> action_controller/cgi_process.rb:90:in
> >>> `session''",
"c:/devel/ruby/lib/ruby/gems/1.8/gems/
> >>> actionpack-1.8.1/lib/action_controller/base.rb:689:in
> >>> `assign_shortcuts''",
> >>>
"c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/
> >>> action_controller/base.rb:326:in
> >>> `process''",
"c:/devel/ruby/lib/ruby/gems/1.8/gems/
> >>> actionpack-1.8.1/lib/action_controller/rescue.rb:20:in
> >>> `process_with_exception''",
> >>> "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/
> >>> dispatcher.rb:34:in
> >>> `dispatch''",
"C:/devel/web/mkrb.salted.login/public/dispatch.rb:10",
> >>>
"c:/devel/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/
> >>> active_support/dependencies.rb:189:in
> >>> `load''",
"c:/devel/ruby/lib/ruby/gems/1.8/gems/
> >>> activesupport-1.0.4/lib/active_support/dependencies.rb:189:in
> >>> `load''",
"c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/
> >>> webrick_server.rb:82:in
> >>> `handle_dispatch''",
> >>> "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/
> >>> webrick_server.rb:35:in
> >>> `service''",
"c:/devel/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in
> >>> `service''",
"c:/devel/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in
> >>> `run''",
"c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:155:in
> >>> `start_thread''",
"c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:
> >>> 144:in
> >>> `start''",
"c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:144:in
> >>> `start_thread''", "c:/devel/ruby/lib/ruby/
> >>> 1.8/webrick/server.rb:94:in `start''",
> >>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:89:in
`each''",
> >>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:89:in
`start''",
> >>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:79:in
`start''",
> >>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:79:in
`start''",
> >>> "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/
> >>> webrick_server.rb:21:in
> >>> `dispatch''", "script/server:48"]
> >>> [2005-05-11 11:34:07] ERROR `/photo/new'' not found.
> >>> _______________________________________________
> >>> Rails mailing list
> >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> >>> http://lists.rubyonrails.org/mailman/listinfo/rails
> >>>
> >>>
> >>>
> >>
> >> _______________________________________________
> >> Rails mailing list
> >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> >> http://lists.rubyonrails.org/mailman/listinfo/rails
> >>
> >>
> >
> >
> > --
> > sam
> > http://www.magpiebrain.com/
> > _______________________________________________
> > Rails mailing list
> > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails
> >
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
Joseph Hosteny
2005-May-11 17:17 UTC
Re: problem w/ login generator: logging in causes problems w/ another controller
Pat,
It''s not in the salted login generator, only the login generator
README. But I put that in today, and will be releasing a new gem.
Joe
On May 11, 2005, at 1:15 PM, Pat Maddox wrote:
> The readme does discuss this. I''ve been using it for over a
month, so
> it surely isn''t a brand new copy of the readme:
>
>
> "It should look something like this :
>
> require_dependency "login_system"
>
> class ApplicationController < ActionController::Base
> include LoginSystem
> model :user
>
> ...
>
> The model :user is required when you are hitting problems to the
> degree of
> "Session could not be restored becuase not all items in it are
known"
>
>
>
> On 5/11/05, Joseph Hosteny <jhosteny-ee4meeAH724@public.gmane.org>
wrote:
>
>> Yes, I will release a 1.0.8 later today with some more README
>> comments as well as two generator fixes (it was hardcoding to
''user''
>> in two instances).
>>
>> Frank, I apologize for forgetting this - Sam did tell me and I simply
>> forgot that the lack of the model statement could cause what you were
>> seeing.
>>
>> Joe
>>
>>
>> On May 11, 2005, at 12:50 PM, Sam Newman wrote:
>>
>>
>>> I hit the same thing - this should really be in the login generator
>>> readme though - I let Joe know so I''m sure he''ll
put it in the
>>> readme
>>> for the next version.
>>>
>>> On 5/11/05, Francisco Hernandez
<lagcisco-b7MHZcQsHeJWk0Htik3J/w@public.gmane.org> wrote:
>>>
>>>
>>>> the error message explains what to do:
>>>>
>>>> Session contained objects
>>>> where the class definition wasn''t available. Remember
to require
>>>> classes for all objects kept in the session. The session has
been
>>>> deleted.
>>>>
>>>> try putting:
>>>> model :user
>>>>
>>>> in your controller to have those dependencies required for you
>>>>
>>>> Frank Kim wrote:
>>>>
>>>>
>>>>
>>>>> I have a User model and a Photo model. The User can have
many
>>>>> Photos.
>>>>>
>>>>> I can work with the Photo model w/o problems, for example
going to
>>>>> /photo/new. However when I login using /user/login,
afterwards I
>>>>> can
>>>>> no longer access any /photo/ URL''s. I always see
this problem and
>>>>> have no idea why. Can anyone help me?
>>>>>
>>>>> #<ActionController::SessionRestoreError: Session
contained objects
>>>>> where the class definition wasn''t available.
Remember to require
>>>>> classes for all objects kept in the session. The session
has been
>>>>> deleted. (Original exception: undefined class/module User
>>>>> [ArgumentError])>
>>>>>
["c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/
>>>>> action_controller/cgi_process.rb:90:in
>>>>> `session''",
"c:/devel/ruby/lib/ruby/gems/1.8/gems/
>>>>> actionpack-1.8.1/lib/action_controller/base.rb:689:in
>>>>> `assign_shortcuts''",
>>>>>
"c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/
>>>>> action_controller/base.rb:326:in
>>>>> `process''",
"c:/devel/ruby/lib/ruby/gems/1.8/gems/
>>>>> actionpack-1.8.1/lib/action_controller/rescue.rb:20:in
>>>>> `process_with_exception''",
>>>>>
"c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/
>>>>> dispatcher.rb:34:in
>>>>> `dispatch''",
"C:/devel/web/mkrb.salted.login/public/dispatch.rb:
>>>>> 10",
>>>>>
"c:/devel/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/
>>>>> active_support/dependencies.rb:189:in
>>>>> `load''",
"c:/devel/ruby/lib/ruby/gems/1.8/gems/
>>>>>
activesupport-1.0.4/lib/active_support/dependencies.rb:189:in
>>>>> `load''",
"c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/
>>>>> webrick_server.rb:82:in
>>>>> `handle_dispatch''",
>>>>>
"c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/
>>>>> webrick_server.rb:35:in
>>>>> `service''",
"c:/devel/ruby/lib/ruby/1.8/webrick/httpserver.rb:
>>>>> 104:in
>>>>> `service''",
"c:/devel/ruby/lib/ruby/1.8/webrick/httpserver.rb:
>>>>> 65:in
>>>>> `run''",
"c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:155:in
>>>>> `start_thread''",
"c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:
>>>>> 144:in
>>>>> `start''",
"c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:144:in
>>>>> `start_thread''",
"c:/devel/ruby/lib/ruby/
>>>>> 1.8/webrick/server.rb:94:in `start''",
>>>>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:89:in
`each''",
>>>>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:89:in
`start''",
>>>>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:79:in
`start''",
>>>>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:79:in
`start''",
>>>>>
"c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/
>>>>> webrick_server.rb:21:in
>>>>> `dispatch''", "script/server:48"]
>>>>> [2005-05-11 11:34:07] ERROR `/photo/new'' not
found.
>>>>> _______________________________________________
>>>>> Rails mailing list
>>>>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
>>>>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Rails mailing list
>>>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
>>>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> sam
>>> http://www.magpiebrain.com/
>>> _______________________________________________
>>> Rails mailing list
>>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
>>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>>
>>>
>>
>> _______________________________________________
>> Rails mailing list
>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
>>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
Jonas Montonen
2005-May-11 17:21 UTC
Re: problem w/ login generator: logging in causes problems w/ another controller
Joseph Hosteny wrote:> Yes, I will release a 1.0.8 later today with some more README > comments as well as two generator fixes (it was hardcoding to ''user'' > in two instances). > > Frank, I apologize for forgetting this - Sam did tell me and I simply > forgot that the lack of the model statement could cause what you were > seeing. > > Joe > > > On May 11, 2005, at 12:50 PM, Sam Newman wrote: > >> I hit the same thing - this should really be in the login generator >> readme though - I let Joe know so I''m sure he''ll put it in the readme >> for the next version. >> >> On 5/11/05, Francisco Hernandez <lagcisco-b7MHZcQsHeJWk0Htik3J/w@public.gmane.org> wrote: >> >>> the error message explains what to do: >>> >>> Session contained objects >>> where the class definition wasn''t available. Remember to require >>> classes for all objects kept in the session. The session has been >>> deleted. >>> >>> try putting: >>> model :user >>> >>> in your controller to have those dependencies required for you >>> >>> Frank Kim wrote: >>> >>> >>>> I have a User model and a Photo model. The User can have many >>>> Photos. >>>> >>>> I can work with the Photo model w/o problems, for example going to >>>> /photo/new. However when I login using /user/login, afterwards I can >>>> no longer access any /photo/ URL''s. I always see this problem and >>>> have no idea why. Can anyone help me? >>>> >>>> #<ActionController::SessionRestoreError: Session contained objects >>>> where the class definition wasn''t available. Remember to require >>>> classes for all objects kept in the session. The session has been >>>> deleted. (Original exception: undefined class/module User >>>> [ArgumentError])> >>>> ["c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/ >>>> action_controller/cgi_process.rb:90:in >>>> `session''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/ >>>> actionpack-1.8.1/lib/action_controller/base.rb:689:in >>>> `assign_shortcuts''", >>>> "c:/devel/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/ >>>> action_controller/base.rb:326:in >>>> `process''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/ >>>> actionpack-1.8.1/lib/action_controller/rescue.rb:20:in >>>> `process_with_exception''", >>>> "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/ >>>> dispatcher.rb:34:in >>>> `dispatch''", "C:/devel/web/mkrb.salted.login/public/dispatch.rb:10", >>>> "c:/devel/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/ >>>> active_support/dependencies.rb:189:in >>>> `load''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/ >>>> activesupport-1.0.4/lib/active_support/dependencies.rb:189:in >>>> `load''", "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/ >>>> webrick_server.rb:82:in >>>> `handle_dispatch''", >>>> "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/ >>>> webrick_server.rb:35:in >>>> `service''", "c:/devel/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in >>>> `service''", "c:/devel/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in >>>> `run''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:155:in >>>> `start_thread''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb: 144:in >>>> `start''", "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:144:in >>>> `start_thread''", "c:/devel/ruby/lib/ruby/ >>>> 1.8/webrick/server.rb:94:in `start''", >>>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each''", >>>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start''", >>>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start''", >>>> "c:/devel/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start''", >>>> "c:/devel/ruby/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/ >>>> webrick_server.rb:21:in >>>> `dispatch''", "script/server:48"] >>>> [2005-05-11 11:34:07] ERROR `/photo/new'' not found. >>>> _______________________________________________ >>>> Rails mailing list >>>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>> http://lists.rubyonrails.org/mailman/listinfo/rails >>>> >>>> >>>> >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >>> >> >> >> -- >> sam >> http://www.magpiebrain.com/ >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Keep up the good work Joseph, looking forward to the 1.08 version // JoNtE
I have a User model and a Photo model. The User can have many Photos. In the Photo Controller I specify the User and Photo model: model :photo, :user However for some reason recently I have been seeing this error and I have no idea why. Can anyone help me? #<ActionController::SessionRestoreError: Session contained objects where the class definition wasn''t available. Remember to require classes for all objects kept in the session. The session has been deleted. (Original exception: undefined class/module User [ArgumentError])> Thanks, Frank
http://wiki.rubyonrails.com/rails/show/HowtoAvoidSessionRestoreError SIMEN BREKKEN / this path leads to the gates of madness. Frank Kim wrote:>I have a User model and a Photo model. The User can have many Photos. > >In the Photo Controller I specify the User and Photo model: > > model :photo, :user > >However for some reason recently I have been seeing this error and I >have no idea why. Can anyone help me? > >#<ActionController::SessionRestoreError: Session contained objects >where the class definition wasn''t available. Remember to require >classes for all objects kept in the session. The session has been >deleted. (Original exception: undefined class/module User >[ArgumentError])> > >Thanks, >Frank >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > > >
That wiki is quite helpful but in my case, it turned out to be happening because of a quote that was not closed in one of the controller methods. I did not notice this for awhile since this error was in a different method from the one that was being called when I saw the session restore error. Thanks! On 5/19/05, Simen Brekken <simen-qaH4BmqzZooOvCyXmLEu7A@public.gmane.org> wrote:> http://wiki.rubyonrails.com/rails/show/HowtoAvoidSessionRestoreError > > SIMEN BREKKEN / this path leads to the gates of madness. > > > > Frank Kim wrote: > > >I have a User model and a Photo model. The User can have many Photos. > > > >In the Photo Controller I specify the User and Photo model: > > > > model :photo, :user > > > >However for some reason recently I have been seeing this error and I > >have no idea why. Can anyone help me? > > > >#<ActionController::SessionRestoreError: Session contained objects > >where the class definition wasn''t available. Remember to require > >classes for all objects kept in the session. The session has been > >deleted. (Original exception: undefined class/module User > >[ArgumentError])> > > > >Thanks, > >Frank > >_______________________________________________ > >Rails mailing list > >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 5/19/05, Frank Kim <mtmusko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> That wiki is quite helpful but in my case, it turned out to be > happening because of a quote that was not closed in one of the > controller methods. I did not notice this for awhile since this error > was in a different method from the one that was being called when I > saw the session restore error. > > Thanks!Hm. Is it possible to somehow test an entire rails application for parse errors like that?> > On 5/19/05, Simen Brekken <simen-qaH4BmqzZooOvCyXmLEu7A@public.gmane.org> wrote: > > http://wiki.rubyonrails.com/rails/show/HowtoAvoidSessionRestoreError > > > > SIMEN BREKKEN / this path leads to the gates of madness. > > > > > > > > Frank Kim wrote: > > > > >I have a User model and a Photo model. The User can have many Photos. > > > > > >In the Photo Controller I specify the User and Photo model: > > > > > > model :photo, :user > > > > > >However for some reason recently I have been seeing this error and I > > >have no idea why. Can anyone help me? > > > > > >#<ActionController::SessionRestoreError: Session contained objects > > >where the class definition wasn''t available. Remember to require > > >classes for all objects kept in the session. The session has been > > >deleted. (Original exception: undefined class/module User > > >[ArgumentError])> > > > > > >Thanks, > > >Frank > > >_______________________________________________ > > >Rails mailing list > > >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > >http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Joe Van Dyk schrieb:> On 5/19/05, Frank Kim <mtmusko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >>That wiki is quite helpful but in my case, it turned out to be >>happening because of a quote that was not closed in one of the >>controller methods. I did not notice this for awhile since this error >>was in a different method from the one that was being called when I >>saw the session restore error. >> >>Thanks! > > > Hm. Is it possible to somehow test an entire rails application for > parse errors like that? >You could try to ''ruby -c'' each .rb file, this will not spot errors in your views though.
On 19.5.2005, at 17:18, Henrik Horneber wrote:> Joe Van Dyk schrieb: >> On 5/19/05, Frank Kim <mtmusko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> That wiki is quite helpful but in my case, it turned out to be >>> happening because of a quote that was not closed in one of the >>> controller methods. I did not notice this for awhile since this >>> error >>> was in a different method from the one that was being called when I >>> saw the session restore error. >>> >>> Thanks! >> Hm. Is it possible to somehow test an entire rails application for >> parse errors like that? > > You could try to ''ruby -c'' each .rb file, this will not spot errors in > your views though.You can also try to evoke the fcgi (or cgi) script from command line. This has helped me to spot weird syntax/parse errors I couldn''t find otherwise. //jarkko -- Jarkko Laine http://jlaine.net http://odesign.fi _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Jarkko Laine wrote:> On 19.5.2005, at 17:18, Henrik Horneber wrote: > >> Joe Van Dyk schrieb: >> >>> On 5/19/05, Frank Kim <mtmusko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>>> That wiki is quite helpful but in my case, it turned out to be >>>> happening because of a quote that was not closed in one of the >>>> controller methods. I did not notice this for awhile since this error >>>> was in a different method from the one that was being called when I >>>> saw the session restore error. >>>> >>>> Thanks! >>> >>> Hm. Is it possible to somehow test an entire rails application for >>> parse errors like that? >> >> >> You could try to ''ruby -c'' each .rb file, this will not spot errors >> in your views though. > > > You can also try to evoke the fcgi (or cgi) script from command line. > This has helped me to spot weird syntax/parse errors I couldn''t find > otherwise.script/console is a great little tool... _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails