两个版本都主要是为了解决漏洞 ,Rails也从2金沙js娱乐场官方网站:.0升级到了5.0

这是一个信息泄漏/会话劫持漏洞,两个版本都主要是为了解决漏洞 ,Rails,Rails也从2.0升级到了5.0,Active Support,Rails,edit将变成/people/1/edit2,admin,cookie.permanent负值,cookies.permanent.signed

金沙js娱乐场官方网站 1

(文/开源中国)    

Action Pack
CHANGELOG

金沙js娱乐场官方网站 1

# /avatars/45 = AvatarsController#showmap.resources :avatars# /people/5/avatar = AvatarsController#showmap.resources :people, :has_one = :avatar

Rails team这两天接连发布了2.3.6和2.3.72.3.6和2.3.7的主要改进有:Action
Pack:
Rack 从1.0.1到1.1.0XSS防御: 兼容rails 3,
并且变成官方的插件:_xss关于cookie: 更方便的cookie jar
addon,你可以直接给cookie.signed 或者
cookie.permanent负值:cookies.permanent.signed[:remember_me] =
current_user.id. 更多请看(不是adobe的那个flash哦):
增强了alert和notice到 self.alert 和 self.notice。增加了类似redirect_to
url, :alert = ‘…’ and :notice = ‘…’.更多请看: 本地化了lable
helperActive Record:Namespace: 支持表名前缀,
需要在module里定义self.table_name_prefixDestroy
用了优化的锁机制计数器缓存: 用Post.reset_counters(1234, :comments)
去计算Post
1234的留言数量并且重置comments_count缓存PostgreSQL:支持的话,永远使用standard-conforming
stringsMySQL:增加了索引长度的支持。:add_ 和
change_column支持列的定位:first = true and :after =ther_columnActive
Support
升级i18n从1.3.3到1.3.7升级TZInfo从0.3.12到0.3.16Multibyte:加速字符串的验证和清除JSON:用YAJL做JSON的encoding,
当然如果YAJL gem存在的话测试: 新增了assert_blank and assert_present.
从 Ruby 1.8.8向下兼容 Object#singleton_class , deprecating our
Object#metaclass.Core: 新增 Object#presence that returns the object if
it’s #present? otherwise returns nil. Example: region =
params[:state].presence || params[:country].presence || ‘US’Core:
新增 Enumerable#exclude? to match include?.Core: 更名 Array#rand to
Array#random_element to avoid collision with Kernel#rand.Core: rename
Date# and Time#last_(month|year) to #prev_(month|year) for Ruby 1.9
forward compatibility.Active ResourceJSON: set
ActiveResource::Base.include_root_in_json = true to serialize as a
hash of model name – attributes instead of a bare attributes hash.
Defaults to false.Action Mailer升级 TMail 从 1.2.3 到
1.2.7.RailtiesSilence RubyGems 1.3.6 deprecation warnings.

  • Action Cable
    CHANGELOG
  • Action Mailer
    CHANGELOG
  • Action Pack
    CHANGELOG
  • Action View
    CHANGELOG
  • Active Job
    CHANGELOG
  • Active Model
    CHANGELOG
  • Active Record
    CHANGELOG
  • Active Storage
    CHANGELOG
  • Active Support
    CHANGELOG
  • Railties
    CHANGELOG

Active Job
CHANGELOG

Rails 3.0 Beta2
发布,此次有一个非常大的进步,添加了一个辅助工具:Bundler。
你可以找到每个框架的详细变化:Action Mailer, Action Pack, Active Record,
Active Resource, Active Model, Active Support, Rails。

2,rescue_from

金沙js娱乐场官方网站 2

Rails 是一个基于 MVC 模型的 Web 应用开发框架。

Active Support
CHANGELOG

点击查看详情:

# should go in config/initializers/mime_types.rbMime.register_alias "text/html", :iphoneclass ApplicationController  ActionController::Base before_filter :adjust_format_for_iphone private def adjust_format_for_iphone if request.env["HTTP_USR_AGENT"]  request.env["HTTP_USER_AGENT"][(iPhone|iPod)/] request.format = :iphone endendclass PostsController  ApplicationController def index respond_to do |format| format.html # renders index.html.erb format.iphone # renders index.iphone.erb end endend

以下列表分别对应 5.2.4.1 版本中每个 gem 的更新内容:

Action View
CHANGELOG

你可以通过 Jeremy McAnally 开发的非常棒的 rails_upgrade plugin 来将
2.3.x 下的应用迁移到 3.0 上,你可以参考他编写的 his update book
升级帮助。

Action Pack: Miscellaneous1,AtomFeedHelper

以下列表分别对应 6.0.2.1 版本中每个 gem 的更新内容:

还有很多新特性,请见每个组件的详细发布说明:

# person is a Person object, which by convention will# be mapped to person_url for lookupredirect_to(person)link_to(person.name, person)form_for(person)
  • Action Cable
    CHANGELOG
  • Action Mailbox
    CHANGELOG
  • Action Mailer
    CHANGELOG
  • Action Pack
    CHANGELOG
  • Action Text
    CHANGELOG
  • Action View
    CHANGELOG
  • Active Job
    CHANGELOG
  • Active Model
    CHANGELOG
  • Active Record
    CHANGELOG
  • Active Storage
    CHANGELOG
  • Active Support
    CHANGELOG
  • Railties
    CHANGELOG

Action Cable

Action Pack:
Multiview
#respond_to得到进一步深入,对multiview使用形如action.format.renderer的模板名,如: