Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

prateek parasher
prateek parasher
806 Points

Ruby on Rails 5 Basics

i need help in this problem

prateek parasher
prateek parasher
806 Points

We're back in the directory for our vet app... Generate a scaffold for a Pet resource. Pet instances should have a single attribute, name, with a type of string.

3 Answers

Jesse Hancock
Jesse Hancock
4,518 Points

Eliot's answer is close but it is missing the Pet instance.

bin/rails generate scaffold Pet name:string

This is the correct answer.

Adriana Cabrera
Adriana Cabrera
14,618 Points

This is the answer that works for me

bin/rails generate scaffold Pet name:string

Eliot Ostling
Eliot Ostling
9,599 Points

This is your question: Generate a scaffold for a Pet resource. Pet instances should have a single attribute, name, with a type of string.

bin/rails generate scaffold name:string

if you're on windows its

ruby bin/rails generate scaffold name:string

As an aside you can create many different attributes that can include integers and even text fields. Hope this helps Cheers