惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 司徒正美
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
美团技术团队
WordPress大学
WordPress大学
罗磊的独立博客
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
MongoDB | Blog
MongoDB | Blog
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
H
Help Net Security
S
SegmentFault 最新的问题
C
Check Point Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
腾讯CDC
Engineering at Meta
Engineering at Meta
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
D
DataBreaches.Net
雷峰网
雷峰网
GbyAI
GbyAI
宝玉的分享
宝玉的分享

Ruby on Rails: Compress the complexity of modern web apps

Safer to_i coercion, custom to_fs formats, and more! This Week in Rails: May 16, 2026 This Week in Rails: May 8, 2026 This Week in Rails: May 1, 2026 Active Record gets better every week Great big Rails World 2026 update: CFP, Corporate Support tickets, workshops Query command for database queries and more Explicit query: and body: kwargs for integration tests and more! Speedup ActiveRecord::LogSubscriber#sql_color and more! This Week in Rails: March 27, 2026 Rails Versions 8.0.5 and 8.1.3 have been released! Rails Versions 7.2.3.1, 8.0.4.1, and 8.1.2.1 have been released! This Week in Rails: March 20, 2026 Validate URI scheme in Action Text and more This Week in Rails: March 6, 2026 Planning Center is the newest Rails Foundation Contributing member Action Text gets Markdown conversion, editor links in devcontainers, and more! BARRA seeks Rails developer Joe Agliozzo is looking for a Rails developer The rise of lighttpd as the alternative web server When longer is better and more is more Snowdevil: First e-tailer on Rails Natural selection for frameworks in Ruby vs Java Address book tutorial in Portuguese Becoming a better programmer with Rails 10 Things Every Java Programmer Should Know About Ruby Really Getting Started in Rails Off the Treadmill, Onto the Rails Rails 0.9.5: A world of fixes and tweaks Rich clients with Rails and XUL
HTML5 sanitizer, path_params and more
David Heinemeier Hansson · 2023-06-02 · via Ruby on Rails: Compress the complexity of modern web apps

Friday, June 2, 2023
Posted by Wojtek

Hi, Wojtek here. Let’s explore this week’s changes in the Rails codebase.

Update Action View to use HTML5 standards-compliant sanitizers
Add support for HTML5 standards-compliant sanitizers, and default to Rails::HTML5::Sanitizer in the Rails 7.1 configuration if it is supported. Action View’s HTML sanitizers can be configured by setting config.action_view.sanitizer_vendor. Supported values are Rails::HTML4::Sanitizer or Rails::HTML5::Sanitizer.

Add “path_params” to “url_for”
The url_for helpers now support a new option called path_params. This might be useful in situations where you only want to add a required param that is part of the route’s URL but for other route not append an extraneous query param.

Assign auto populated columns on Active Record object creation
Changes record creation logic to allow for the auto_increment column to be assigned right after creation regardless of it’s relation to model’s primary key. PostgreSQL adapter benefits the most from the change allowing for any number of auto-populated columns to be assigned on the object immediately after row insertion utilizing the RETURNING statement.

Handle “sanitize_options” in “simple_format” helper
Sanitize functionality can now be configured via passed options.

Set “default_shard” from “connects_to” hash
Some applications may not want to use :default as a shard name in their connection model. Unfortunately Active Record expects there to be a :default shard because it must assume a shard to get the right connection from the pool manager. Rather than force applications to manually set this, connects_to can infer the default shard name from the hash of shards and will now assume that the first shard is your default.

Add health check configuration
Added health_check_path and health_check_application config to mount a given health check rack app on a given path. Useful when mounting Action Cable standalone.

Support VISUAL env var and prefer it over EDITOR
When opening a temporary file for editing encrypted files.

Allow an Active Storage attachment to be removed via a form post
Attachments can already be removed by updating the attachment to be nil such as: User.find(params[:id]).update!(avatar: nil)

However, a form cannot post a nil param, it can only post an empty string. But, posting an empty string would result in an ActiveSupport::MessageVerifier::InvalidSignature: mismatched digest error being raised, because it’s being treated as a signed blob id. Now, nil and an empty string are treated as a delete, which allows attachments to be removed via: User.find(params[:id]).update!(params.require(:user).permit(:avatar))

You can view the whole list of changes here.
We had 23 contributors to the Rails codebase this past week!

Until next time!

Subscribe to get these updates mailed to you.