Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Stympy/faker on github has lots of fun "data" for you to run in your program while you are working on them.
- Every time you change a gem file you must bundle install in your terminal.
- When using the post, patch and delete routes - we are not displaying information - when using these, we are going
- to redirect.
- flash hash - flash messages
- flash[:success] = "Successfully Updated"
- Associations - going on BEYOND spreedsheet style - 3D style of spreedsheet
- Whenever you create a model, you also create a migration file. Once you make you the migration file, you can edit it up until
- you rake db:migrate
- t.timestamps - short hand for created and updated at.
- three things can happen when you migrate
- error/success/tumbleweeds(nothing)
- schema - report of the current stucture of your database - do not change schema
- If I want to change my database, I must add a new migration.
- rails g migration AddPriceToProducts (ADD) attribute (changable) (To) table(changable)
- Postgres does NOT allow floats. It allows decimals - takes a little extra storage, but it is more accurate for $$
- string
- text
- integer
- float
- decimal
- boolean
- binary (images, movies, raw format)
- :primary_key (helps with speed with reading/writing)
- date
- time
- datetime
- timestamp
- when using decimals in databases - precision represents how many digits total,
- scale is the number of digits to the right of the decimal
Add Comment
Please, Sign In to add comment