ActiveRecord
- ORM模型 ①数据库高级封装 ②不使用SQL语句
- 数据库类–类
- 行记录–实例对象
- 字段–对象的属性
- user.errors.full_messages(命令行)
- <%= devise_error_messages! %> <% if user.errors.any? %>
ActionView
- erb ===>Embedded Ruby
- actionview处理view元件
- 前端模板==>动态生成html
- 解析html
- <%= %> 或<% %>模板标示符,ruby语言
- link_to “链接显示文字” options ={} html_options ={}
- url生成的是绝对路径,而path生成的则是相对路径
- form_for , form_tag
- coffee ==> coffeescript 前端脚本开发
Assets Pipeline
- application ===> 打包和解压
- assets 静态资源 lib/vendor/app
- require_dictionary 和 require_tree
运行环境
- Development 开发环境
- Test 测试环境
- Production 上线环境(生产环境)
- config.consider_all_requests_local = false 错误信息反馈
Bundle 与 Gemfile
- bundler === gem 包管理,依存关系,版本一致性
- gemfile === 明确每一个gem版本,版本号的含义
- bundler命令 ①bundle install—Gem file.lock ②bundle update gem_name ③bundle update ④bundle outdated