rails 结构

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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值