Chapter 7 Flashcards
rails command for running test suite
$ bundle exec rake test
rails command for starting a console session where session commands are rolled back at end of session.
$ rails console –sandbox
$ rails generate model User name:string email:string
What does name:string do in this command?
in the migration file that this command generates, the migration will have functions which add a Name row to the db table. Entries in this row will be string objects.
How would you run the rails server in a different environment?
$ rails server –environment production
$ rails s –environment test
What are the three Rails environments?
development, test, and production
If you view your app running in production, it won’t work without a production database, which we can create by running rake db:migrate in production:
what is the rails command for that?
$ bundle exec rake db:migrate RAILS_ENV=production
Command for displaying a gems location.
$ bundle show [gem]
HTTP’s four fundamental operations
POST, GET, PATCH, DELETE
method for changing a resource’s attributes
update_attributes
command for resetting the database, aka wiping out all entries
$ bundle exec rake db:migrate:reset
ORM
stands for
Object Relational Mapper
Initializing an object with a hash as an argument is called:
Mass assignment
user.errors.count
what will the #count method do?
return the number of errors
Jargon word for temporary message that displays on web page
flash
rails method for constructing a form
form_for