I am using ActiveRecordStore for my session storage. I would like an additional field "foo" to be saved when the session gets stored: create table sessions( id int(11) not null auto_increment, sessid varchar(255), data text, foo varchar(255) ) Is it possible to substitute in a custom class for CGI::Session so that I can set the attribute session.foo? I know you can set a custom session storage class with CGI::Session::ActiveRecordStore.session_class = XXXSession, but that only lets you override how the session is stored. I don''t believe that lets you set custom attributes on a CGI::Session object itself. thanks, Jeff
yoorobot-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2005-Aug-03 21:24 UTC
passing the params hash via redirect_to
Hi all,
I''m trying to modify and pass along the params (append the id of a
newly created object) hash as I redirect from one controller to another:
redirect_to :controller=>''other'',
:action=>''create'', :params=>params
which doesn''t work of course ( seems to concatenate all the key/vals
into a string ). How should I pass the params hash to a second
controller?
- James
James,
Try this:
redirect_to {:controller => ''other'', :action =>
''create''}.merge(params)
-Jeff
----- Original Message -----
From: <yoorobot-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: <rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org>
Sent: Wednesday, August 03, 2005 3:24 PM
Subject: [Rails] passing the params hash via redirect_to
> Hi all,
>
> I''m trying to modify and pass along the params (append the id of a
> newly created object) hash as I redirect from one controller to another:
>
>
> redirect_to :controller=>''other'',
:action=>''create'', :params=>params
>
> which doesn''t work of course ( seems to concatenate all the
key/vals
> into a string ). How should I pass the params hash to a second
> controller?
>
> - James
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
try this: redirect_to params.merge(:controller => ''other'', :action => ''create'') -- rick http://techno-weenie.net
yoorobot-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2005-Aug-04 17:50 UTC
Re: passing the params hash via redirect_to
thanks for the replies... unfortunately.. ... merging, clone/ updating, all of the seem to stringify the hash before passing it. boo, I say. James On Aug 3, 2005, at 4:41 PM, Rick Olson wrote:> try this: > > redirect_to params.merge(:controller => ''other'', :action => ''create'') > > -- > rick > http://techno-weenie.net > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >