I read the typo migration code file 004_add_sidebars_.rb and found these: Bare4Sidebar.create(:active_position=>0, :controller=>''page'', :active_config=>''--- !map:HashWithIndifferentAccess maximum_pages: "10"'') I''m confused what does it meaning? work for? anyone help~ -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Guan, HashWithIndifferentAccess is just like any other hash except that the key ''somekey'' will be the same as the key :somekey. For example if you have a regular hash like the following>> hash = Hash.new({:somekey => ''testing''}) >> hash[:somekey]=> testing>> hash[''somekey'']=> nil Notice how the key ''somekey'' is not the same as the key :somekey>> hash = HashWithIndifferentAccess.new({:somekey => ''testing''}) >> hash[:somekey]=> ''testing''>> hash[''somekey'']=> ''testing'' Here the key ''somekey'' and :somekey are the same. Understand? -- Robert Zotter Zapient, LLC Ruby on Rails Development and Consulting http://www.zapient.com http://www.fromjavatoruby.com On Oct 25, 7:05 am, Zhenning Guan <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I read the typo migration code file 004_add_sidebars_.rb and found > these: > > Bare4Sidebar.create(:active_position=>0, :controller=>''page'', > :active_config=>''--- !map:HashWithIndifferentAccess > maximum_pages: "10"'') > > I''m confused what does it meaning? work for? > anyone help~ > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 25 Oct 2008, at 15:05, Zhenning Guan wrote:> > I read the typo migration code file 004_add_sidebars_.rb and found > these: > > Bare4Sidebar.create(:active_position=>0, :controller=>''page'', > :active_config=>''--- !map:HashWithIndifferentAccess > maximum_pages: "10"'') > > I''m confused what does it meaning? work for?That looks like yaml serialized data. Fred> > anyone help~ > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---