Skip to content

Conversation

ASPhillips8
Copy link

Created puppy class that is initialized with name, breed, and age. Created a puppy form that has action towards /puppy endpoint. Displayed new puppy through use of erb. Displayed link on homepage that bring to puppy form.
Screenshot 2024-08-08 at 1 53 41 PM
Screenshot 2024-08-08 at 1 53 56 PM
Screenshot 2024-08-08 at 1 54 21 PM

Comment on lines +14 to +17
@name = params[:name]
@breed = params[:breed]
@age = params[:age]
erb :display_puppy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to use the Puppy class here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so like erb :puppy

or were you referring to
@puppy.age = params[:puppy][:age]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More like

@puppy = Puppy.new(params[:name], params[:breed], params[:age])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants