ShanzyHolm / Animal_Shelter-Ruby_Project

CodeClan Week-long Solo Project 1. Object oriented programming with Ruby, Test Driven Development, Web Programming (REST, MVC), Interacting with a PostgreSQL database (CRUD), HTML / CSS, and Sinatra. Home Away From Holmes Animal Shelter was a week long independent full stack web programming project which would enable shelter employees to track animals available at the shelter, register an owners interest in an animal, and maintain both owner and animal information. It allowed the shelter to perform CRUD operations, using forms to update both owners and animals information, as well as creating new adoptions to pair up owners and animals.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.