Access denied, Please sign in and make sure you have proper permission.
-
API mode
rails new backend --api
-
Action Cable by DHH
- Ruby 2.2.2+
- puma is default server
- rails g 生成的 model 父类是
ApplicationRecord
Post.where('id = 1').or(Post.where('id = 2'))
- Active Record callbacks 返回 false 时不会退出
ActiveSupport.halt_callback_chains_on_return_false = false
- 模板文件名不必是合法的 ruby 标识符,_🍔.html.erb
-
ActionController::Renderer
在 controller actions 之外渲染模板,比如 background job 👏
-
redirect_back
代替 redirect_to :back
, 而且带一个必需的fallback_location
参数
CHANGELOG
+1
加强了对类 WebSocket 和 API 的支持。
用起来
以后
rails db:create
rails db:migrate
Active Record callbacks 返回 false
这个会让很多项目升级困难
😂
#17 楼 @huacnlee 这个是可以配置的 ActiveSupport.halt_callback_chains_on_return_false = true
就和以前的一样了
貌似 doorkeeper 不支持 rails5 呢 不知道 team 里其他基佬进展如何了...
#22 楼 @rubyu2 我已经升级了一个 project 到 Rails 5.0.0.beta1,下面几个 Gem 要使用 master 版:
gem 'will_paginate', git: 'https://github.com/jonatack/will_paginate'
gem 'devise', git: 'https://github.com/plataformatec/devise'
gem 'ransack', git: 'https://github.com/activerecord-hackery/ransack'
其余还好,还有就是skip_before_filter
要写skip_before_action
,API 模式下似乎方法verify_authenticity_token
也去除了。
目前mongoid 5.0.1
还不支持rails 5.0.0.beta1
。