037. rails, postgres, angular, bootstrap - cwy007/tips-and-skills GitHub Wiki

  1. postgreSQL 开源数据库
  2. mySQL 开源数据库
  3. $ createuser --createdb --login -P shine

You’ll be prompted for a password, so enter shine twice, as requested. --createdb tells Postgres that our user should be able to create databases (needed in a later step). The --login switch will allow our user to log in to the database and -P means we want to set our new user’s password right now (which is why you were prompted for a password)

  1. $ psql postgres

  2. NPM to manage Shine’s dependency on Bootstrap’s code, and Webpack to serve it up.

  3. a system like Bundler, Bundler only manages RubyGems

  4. the package manage- ment system for JavaScript (and the rest of the front-end ecosystem): NPM.

  5. NPM is part of Node.js and is the Node equivalent of Bundler

  6. Gemfile, NPM uses a file named package.json

  7. Webpack vs Sprockets 驱动assets

  8. Webpack is an asset pipeline

  9. authentication 验证 devise

  10. 在终端查看数据库 Postgres

$ bundle exec rails dbconsole
postgres> \x on
Expanded display is on.
postgres> select * from users;
  1. sensible 使用的
  2. scheme 方案
  3. initializer 初始化器
  4. Active Record provides the method update_attribute, which skips validations
  5. check constraints 检查约束
  6. vulnerabilities 漏洞, 弱点
  7. powerful features 强大的功能
  8. circumvent 规避,绕过
  9. introduce 引入
  10. weigh 权衡
  11. null constraint, not null
  12. Postgres Data Definition Language (DDL)
  13. execute method to execute arbitrary SQL:

Product.connection.execute("UPDATE products SET price = 'free' WHERE 1=1")

  1. the migrations DSL
  2. dump 转存
  3. security or user experience