Rails commands by command name Flashcards

How do you generate a scaffold? How can I run JUST the integration tests? Internalize these Rails commands and become a faster coder.

1
Q

What does this Rails command do?

rails new ApplicationName

A

Creates a new application

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

What does this Rails command do?

rails generate/g model ModelName

A

Creates a model with the specified model_name

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

What does this Rails command do?

rails generate/g controller ControllerName

A

Creates a controller with the specified controller_name

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

What does this Rails command do?

rails generate/g migration MigrationName

A

Creates a migration with the specified migration_name

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

What does this Rails command do?

rails generate/g scaffold ModelName ControllerName

A

Provides shortcut for creating your controller, model and view files etc.

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

What does this Rails command do?

rails destroy controller ControllerName

A

Destroys the created controller and its related files. Same way you can destroy your model, migration files etc.

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

What does this Rails command do?

rails server/s

A

Starts ruby server at http://localhost:3000

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

What does this Rails command do?

rails console/c

A

Opens the rails console for the current RAILS_ENV

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

What does this Rails command do?

rails dbconsole/db

A

Opens the DB console for the current RAILS_ENV

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

What does this Rails command do?

rake test:profile

A

Profiles your application.

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

What does this Rails command do?

rake -T

A

Lists all available rake tasks

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

What does this Rails command do?

rake db:create

A

Creates the database defined in config/database.yml for the current RAILS_ENV

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

What does this Rails command do?

rake db:drop

A

Drops the database for the current RAILS_ENV

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

What does this Rails command do?

rake db:migrate

A

Migrates the database through scripts in db/migrate folder.

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

What does this Rails command do?

rake db:reset

A

Drops and recreates the database from db/schema.rb for the current environment.

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

What does this Rails command do?

rake db:rollback

A

Runs the down method from the latest migration.

17
Q

What does this Rails command do?

rake db:schema:dump

A

Creates a db/schema.rb file that can be portably used against any Data Base (DB) supported by Active Record (AR).

18
Q

What does this Rails command do?

rake doc:app

A

Builds the RDOC HTML Files

19
Q

What does this Rails command do?

gem list

A

Lists the gems that this rails application depends on

20
Q

What does this Rails command do?

bundle install

A

Installs all required gems for this application.

21
Q

What does this Rails command do?

rake log:clear

A

Truncates all *.log files in log/ to zero bytes

22
Q

What does this Rails command do?

rake routes

A

Prints out all defined routes in match order, with names.

23
Q

What does this Rails command do?

rake test

A

Runs all unit, functional and integration tests

24
Q

What does this Rails command do?

rake test:functionals

A

Runs tests for functionalsdb:test:prepare /
Runs the functional tests in test/functional

25
Q

What does this Rails command do?

rake test:integration

A

Runs tests for integrationdb:test:prepare /
Runs the integration tests in test/integration

26
Q

What does this Rails command do?

rake test:units

A

Runs tests for unitsdb:test:prepare /
Runs the unit tests in test/unit

27
Q

What does this Rails command do?

rake tmp:clear

A

Clears session, cache, and socket files from tmp/

28
Q

What does this Rails command do?

gem list

A

Lists all the installed gems.

29
Q

What does this Rails command do?

gem install GemName

A

Installs the specified gem in to your machine.

30
Q

What does this Rails command do?

gem uninstall GemName

A

Uninstalls the specified gem from your machine.

31
Q

What does this Rails command do?

gem server

A

Presents a web page at http://localhost:8808/ with info about installed gems.

32
Q

What does this Rails command do?

rake test:benchmark

A

Benchmarks your application.