hi,can anyone tell me how a session variable can store in table,, --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Oct 29, 4:19 pm, ruby_ishk <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hi,can anyone tell me how a session variable can store in table,,Do you mean change from storing sessions in a cookie to storing in your database? Or do you mean something to do with using the session? -- Daniel Bush --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
no, suppose that there''s a person who has logged in to a site and when he fill a form so the data should be stored in a table with his user id which has stored in his session. so how can i store it. On 29/10/2008, Daniel Bush <dlb.id.au-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On Oct 29, 4:19 pm, ruby_ishk <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > hi,can anyone tell me how a session variable can store in table,, > > Do you mean change from storing sessions in a cookie to storing in > your database? > Or do you mean something to do with using the session? > > > -- > Daniel Bush > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Oct 30, 12:09 am, "Ishara Gunathilake" <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> no, suppose that there''s a person who has logged in to a site > and when he fill a form so the data should be stored in a table > with his user id which has stored in his session. so how can > i store it. >You could access the session in the controller at the time the user submits. Depends on what your authentication system does. For instance it might be session[:user]. So you have to do something like user=User.find(session[:user]) or User.exists?(session[:user]) to verify the user id is valid. There may be helper methods which come with whatever plugin or system you''re using so you should check them out. If you don''t have a system, there are quite a few. acts_as_authenticated, restful_authentication to name 2. You''ll need to install one of them and read how to use it. -- Daniel Bush --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thank you very much,now i can understand what should i do On 29/10/2008, Daniel Bush <dlb.id.au-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > > On Oct 30, 12:09 am, "Ishara Gunathilake" <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > no, suppose that there''s a person who has logged in to a site > > and when he fill a form so the data should be stored in a table > > with his user id which has stored in his session. so how can > > i store it. > > > > You could access the session in the controller at the time the user > submits. > Depends on what your authentication system does. > For instance it might be session[:user]. So you have to do something > like > user=User.find(session[:user]) > or > User.exists?(session[:user]) > to verify the user id is valid. > There may be helper methods which come with whatever plugin or system > you''re using > so you should check them out. > > If you don''t have a system, there are quite a few. > acts_as_authenticated, restful_authentication to name 2. > You''ll need to install one of them and read how to use it. > > > -- > Daniel Bush > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---