Rails Fixtures - what do these mean?
Context
When I generate the fixture file, rails generate model Post title:string
text:text it shows:
one:
title: MyString
text: MyText
two:
title: MyString
text: MyText
Question
I was wondering why are there 2, and why are they named "one" and "two".
Here I see that names like "google", "rubyonrails", and "parent/child" are
used; whereas, following the tutorial for generating the posts model, it
generates just one and two...
Upon more research, I found that I might also be interested in db/migrate
files. My current theory is that these files create the structure of my
data... so I'm not so sure what fixtures does.
Reason
I'm trying to create a "Student" model using
rails generate scaffold student
but it doesn't seem to have :name as one of its keys. I'm looking into
fixtures to add data columns.
No comments:
Post a Comment