-
Notifications
You must be signed in to change notification settings - Fork 0
Cheatsheet
Migratiom to create table: rails generate migration SetupAccountsTable username:string release_date:datetime rating:string description:text
rails generate migration AddFieldsToMovies title:string release_date:datetime rating:string description:text
Create controller: ("new", "edit" are methods) rails generate controller Users new edit
Basic Model: rails generate model User name:string email:string
After migration should do this: bundle exec rake db:migrate
To undo migration do this: bundle exec rake db:rollback
install GEM bcrypt for login: bundle install & gem install bcrypt-ruby
*** note : bcrypt need to be versioned 3.0.0 to 3.0.9 to work
Authenticate: password field cannot be show, use this user.authenticate("password") == True to check, first need to get user by User.where(email: "asd").first (need the first to query)
to return True use this !!user.authenticate("asd")
*** run this before cucumber: rake db:test:prepare
*** run this after deploying on heroku: heroku run rake db:migrate (db:seed)