Handy Commands Flashcards

1
Q

What is the command which will generate a model with a model, migration file, views & more?

A

rails g model Article title:string body:text

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you view all the routes?

A

rails routes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do fire up the rails server on a different port?

A

rails s -p 3001

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you migrate your migration files into the database and would you migrate a specific file?

A

rails db:migrate

rails db:migrate:up VERSION=migration_file_number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How would you drop create and migrate with one command?

A

rails db:reset

How well did you know this?
1
Not at all
2
3
4
5
Perfectly