I did the exercises in M. Hartle 's Ruby-on-Rails tutorial . I did all the exercises in chapter 4, but was stuck with this:
Create three hashes called person1, person2and person3, with first and last names under the :firstand keys :last. Then, create a hash paramsthat params[:father]has been person1, params[:mother]is person2, and params[:child]- person3. Make sure that, for example, params[:father][:first]has the correct value.
person1
person2
person3
:first
:last
params
params[:father]
params[:mother]
params[:child]
params[:father][:first]
Can anyone suggest how to approach this problem? I do not want to go to the next chapter until I solve this.
person1 = {:first => 'Al', :last => 'Bundy'} person2 = {:first => 'Peggy', :last => 'Bundy'} person3 = {:first => 'Kelly', :last => 'Bundy'} params = { :father => person1, :mother => person2, :child => person3 } params[:father][:first] #=> 'Al'
Hash. , , javascript:
person1 = {first: "Papa", last: "Bear"} person2 = {first: "Mama", last: "Bear"} person3 = {first: "Baby", last: "Bear"} params = {father: person1, mother: person2, child: person3}