Example In the overview section, we introduced the design for helpers. They are modules that enrich views’ behaviors. Because they are just Ruby modules, we can create our own ...
Hanami::Validations is a mixin that, once included by an object, adds lightweight set of validations to it. It works with input hashes and lets us to define a set of validation...
When an unsuccessful request is returned, there are some special pages that a Hanami application presents to users. These pages have a generic graphic and some basic information ...
A Simple Action Naming Action Module Interface An action is an endpoint that handles incoming HTTP requests for a specific route . In a Hanami application, an action is an ob...
Entity Schema Automatic Schema An entity is domain object that is defined by its identity. See “Domain Driven Design” by Eric Evans . An entity is at the core of an applicati...
Enable Sessions Usage Sharing session values between applications Enable Sessions Sessions are available in Hanami applications, but not enabled by default. If we want to tur...
Use Ruby 2.2+ Edit your Gemfile , by changing Hanami version: gem 'hanami', '~> 0.8' . Create a group :development in Gemfile and add gem 'shotgun' Create a group :deve...
Testing actions Running Tests Providing params and headers Mocking action dependencies Testing requests Hanami actions are designed to be easy to test via a range of techniq...
Provider lifecycle Accessing the container via target Providers are a way to register components with your containers, outside of the automatic registration mechanism detailed...
Enable Cookies Settings Usage Example Enable Cookies Hanami applies “batteries included, but not installed” philosophy. Cookies are a feature that is present but needs to be...