hanami

Hanami

Specific best practices and architectural patterns when working with Hanami.

Details

Language / Topic
rubyRuby
Category
framework

Rules

balanced

Hanami

- Use slices (Hanami 2.x) to organize code by feature — each slice has its own actions, views, and repos. Use `Hanami::Action` for request handling with explicit `handle` methods. Use dry-rb conventions for validation and types.

Hanami

- Use slices (Hanami 2.x) to organize code by feature — each slice has its own actions, views, and repos. Use `Hanami::Action` for request handling with explicit `handle` methods. Use dry-rb conventions for validation and types.
- Use `Hanami::Repo` with ROM relations for database access — separate persistence from domain logic. Use `Hanami::View` with templates and parts for presentation logic. Register dependencies in slice containers — inject with `include Deps["my_service"]`. Use `Hanami::Router` DSL for routing with named routes. Configure environment settings in `config/settings.rb`.