Rails commands by command name Flashcards Preview

Ruby on Rails > Rails commands by command name > Flashcards

Flashcards in Rails commands by command name Deck (32):
1

rails new ApplicationName

Creates a new application

2

rails generate/g model ModelName

Creates a model with the specified model_name

3

rails generate/g controller ControllerName

Creates a controller with the specified controller_name

4

rails generate/g migration MigrationName

Creates a migration with the specified migration_name

5

rails generate/g scaffold ModelName ControllerName

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

6

rails destroy controller ControllerName

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

7

rails server/s

Starts ruby server at http://localhost:3000

8

rails console/c

Opens the rails console for the current RAILS_ENV

9

rails dbconsole/db

Opens the DB console for the current RAILS_ENV

10

rake test:profile

Profiles your application.

11

rake -T

Lists all available rake tasks

12

rake db:create

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

13

rake db:drop

Drops the database for the current RAILS_ENV

14

rake db:migrate

Migrates the database through scripts in db/migrate folder.

15

rake db:reset

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

16

rake db:rollback

Runs the down method from the latest migration.

17

rake db:schema:dump

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

18

rake doc:app

Builds the RDOC HTML Files

19

gem list

Lists the gems that this rails application depends on

20

bundle install

Installs all required gems for this application.

21

rake log:clear

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

22

rake routes

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

23

rake test

Runs all unit, functional and integration tests

24

rake test:functionals

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

25

rake test:integration

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

26

rake test:units

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

27

rake tmp:clear

Clears session, cache, and socket files from tmp/

28

gem list

Lists all the installed gems.

29

gem install GemName

Installs the specified gem in to your machine.

30

gem uninstall GemName

Uninstalls the specified gem from your machine.

31

gem server

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

32

rake test:benchmark

Benchmarks your application.