Elektrine lite

← Feed

@afomera@ruby.social

Post #2641502

2025-10-14 21:02 UTC

@hanami provides the ability to reuse param validations/definitions across actions. In each action class you can define `params` blocks, but you can also make those into reusable classes that can be shared (and tested!) if you have a common set of params that need to be used! #HanamiTips

Replies (1)

  • @francois@ruby.social 2025-10-15 02:35

    @afomera@ruby.social @hanami@ruby.social this is one thing I « dislike » about Hanami: the screenshot above is six levels of indentation, before I write anything. I believe Hanami uses Zeitwerk? If so, why aren’t the generated classes using the « short » version of class declarations? class Bookshelf::Actions::Users::Params < Hanami::Action::Params params do # my code end end I feel like that would improve readability. I know, open source, contribute. I’m not using Hanami yet. I would, when I’ll use it.

    Open ##2812308