Hello.I want to create a cookie with multiple values and call them individually. How it works? -- Posted via http://www.ruby-forum.com/.
Might need more information. If you are looking to store multiple values (e.g., an array) you could convert it to a string for the value of the cookie: cookies[:somename] = some_array.join(":") ... some_array = cookies[:somename].split(":") On Fri, Nov 13, 2009 at 3:51 AM, Cookie Rails < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hello.I want to create a cookie with multiple values and call them > individually. How it works? > -- > Posted via http://www.ruby-forum.com/. > > > >-- Darian Shimy --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I am trying to create a list of values in a cookie, to avoid creating more cookies. And then invoke a single value, for example: Cookies [: evidence] = {: value1 = ''one'': value2 = ''2'': value3 = > ''3''} and then invoke cookies [: tests: value1] but this syntax is wrong. -- Posted via http://www.ruby-forum.com/.
I need a cookie because I have store different sessions and use them in different actions of the controller, -- Posted via http://www.ruby-forum.com/.
Cookie Rails wrote:> I am trying to create a list of values in a cookie, to avoid creating > more cookies. And then invoke a single value, for example: > cookies [: prove] = {: value1 = ''one'': value2 = ''2'': value3 = > ''3''} > > and then invoke cookies [: prove : value1] > but this syntax is wrong.-- Posted via http://www.ruby-forum.com/.
Again I would just serialize the value. On Fri, Nov 13, 2009 at 9:06 AM, Cookie Rails < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I am trying to create a list of values in a cookie, to avoid creating > more cookies. And then invoke a single value, for example: > Cookies [: evidence] = {: value1 = ''one'': value2 = ''2'': value3 = > ''3''} > > and then invoke cookies [: tests: value1] > but this syntax is wrong. > > -- > Posted via http://www.ruby-forum.com/. > > > >-- Darian Shimy --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---