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

推荐订阅源

U
Unit 42
罗磊的独立博客
T
Tailwind CSS Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
V
V2EX
美团技术团队
阮一峰的网络日志
阮一峰的网络日志
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
量子位
MyScale Blog
MyScale Blog
G
Google Developers Blog
M
MIT News - Artificial intelligence
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
B
Blog

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
Automated shard swapping middleware, standardised error r...
David Heinemeier Hansson · 2021-11-21 · via Ruby on Rails: Compress the complexity of modern web apps

Sunday, November 21, 2021
Posted by gregmolnar

Hey, this is Greg, bringing you the latest news about Ruby on Rails.

Support <form> elements without [action] By default, when a form is declared without an action attribute, browsers will encode the form’s fields into the current URL. Prior to this commit, none of the form construction variations supported declaring a form without an action attribute, form_with, form_for, and form_tag all default to url_for({}) when a url or action option is omitted, but with this change, when they are set to false, the form will be rendered without an action attribute.

Support authenticity_token option in button_to helper This PR adds support for passing authenticity_token option to button_to, the same way as in form_with and form_for calls.

Introduce field_name view helper The field_name helper and corresponding FormBuilder#field_name method provides an Action View compliant way of overriding an element’s name attribute. For instance you can do the following:

text\_field\_tag :post, :tag, name: field\_name(:post, :tag, multiple: true) # =\> \<input type="text" name="post[tag][]"\>

Automatic shard swapping middleware This PR adds a middleware that can be used for automatic shard swapping. The design is similar to the database selector middleware in that the resolver is provided by the application to determine which shard to switch to. The selector also takes options (the only supported one is lock yet) to change the default behavior of the middleware.

Standardised error reporting interface Rails.error is a new error reporting interface, with two block based methods. handle, which swallows errors and forwards them to the subscribers:

Rails.error.handle do 1 + '1' # raises TypeError end 1 + 1 # This will be executed

and record, which forwards the errors to the subscribes but lets it continue rewinding the call stack:

Rails.error.record do 1 + '1' # raises TypeError end 1 + 1 # This won't be executed.

For cases where the blocked based API isn’t suitable, the lower level report method can be used:

Rails.error.report(error, handled: true / false)

Filter attributes in SQL logs with debug SQL queries are logged when the Rails log level is set to :debug and previously, filter attributes were not masked in the logs in this case. With this change, filter attributes will be masked as [FILTERED] in the logs, but he filtration is applied only when prepared_statement is enabled.

Speed up collection rendering and add support for multifetch collection handling in jbuilder This PR speeds up collection rendering by taking advantage of the existing collection renderer in Action View, and it adds support for multifetch collection handling to make it more efficient.

33 people contributed to Rails since last time. We couldn’t cover all the changes, but you can see all of them here. Until next time!