Can't get it to display owner and animal names in the adoptions/index.erb
ShanzyHolm opened this issue · comments
Trying to display owner and animal names in the adoptions/index.erb; congratulating and confirming adoption was successful...
Have tried:
We hope that <%= @owner.owner_name() %> and <%= @animal.name() %> are very happy together!
----Get: NoMethodError at /adoptions undefined method `owner_name' for nil:NilClass file: index.erb location: block in singleton class line: 5
We hope that <%= @adoption.owner(owner_name) %> and <%= @adoption.animal(name) %> are very happy together!
----Get: NameError at /adoptions undefined local variable or method `owner_name' for #Sinatra::Application:0x007fef83879310 file: index.erb location: block in singleton class line: 5
We hope that <%= @adoption.owner.first_name() %> and <%= @adoption.animal.name() %> are very happy together!
----Get: NoMethodError at /adoptions undefined method `owner' for nil:NilClass file: index.erb location: block in singleton class line: 5
We hope that <%= @adoptions.owner.first_name() %> and <%= @adoptions.animal.name() %> are very happy together!
----Get: NoMethodError at /adoptions undefined method `owner' for #Array:0x007fef815a6fe0
file: index.erb location: block in singleton class line: 5
This error was sorted out and is now working.