Ancestors

Toot

Written by Matheus Richard on 2024-09-09 at 15:07

Rails recently merged a new API to deal with params. Instead of the common pattern params.require(:user).permit(:name, :age) now we should write params.expect(user: [:name, :age]).

This is not only shorter but also better deals with param tampering. For example, the following /path?user=string would break with require+permit but not with expect.

[#]ruby

=> View attached media

=> More informations about this toot | More toots from matheusrich@mastodon.social

Descendants

Written by Matheus Richard on 2024-09-09 at 15:08

Here's the PR: https://github.com/rails/rails/pull/51674

=> More informations about this toot | More toots from matheusrich@mastodon.social

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113108220397779351
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
259.851936 milliseconds
Gemini-to-HTML Time
0.491576 milliseconds

This content has been proxied by September (3851b).