This Week in Rails

September 23, 2022

Improved assert_redirected_to, improved error messages and more!

Hi, this is Greg, bringing you the latest changes in the Rails framework.

Allow specifying the HTTP status code in assert_redirected_to
Before this change, assert_redirect_to asserted any 3XX response, but with this change, it is possible to assert a specific response code, like 301.

Allow passing classes to dom_id
Allowing dom_id to receive a Ruby class, instead of an instance of a class, makes it behave like dom_class, and besides saving a few keystrokes, it saves memory too, because Ruby doesn't need to instantiate an entire object with all its callbacks and such.

Improve error messages on bin/setup
Changing bin/setup to use system(..., exception: true) gives more information when a command fails, and makes debugging easier.

Allow to pass --force to db:system:change
db:system:change always prompts to confirm the overwriting of database.yml, but now there is a --force option to skip the confirmation prompt.

Turbo 7.2.0 was released
There is a new release for Turbo, which is also available via turbo-rails 1.3.0. You can read the list of changes on the link above.

We had 24 contributors to Rails this week! If you want to be part of that, checkout the issues list!
Until next time!