# Hanami, Why?: Class Action

**URL:** <https://discourse.hanakai.org/t/hanami-why-class-action/1563>\
**Category:** sharing\
**Created:** [October 12, 2026, 2:10pm UTC](https://discourse.hanakai.org/t/hanami-why-class-action/1563 "2026-10-12T14:10:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaronmallen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.hanakai.org/aaronmallen/32/890_2.png) [@aaronmallen](https://discourse.hanakai.org/u/aaronmallen)\
**Post date:** [October 12, 2026, 2:10pm UTC](https://discourse.hanakai.org/t/hanami-why-class-action/1563/1 "2026-10-12T14:10:17Z")

</div>

> **[Hanami, Why?: Class Action](https://aaronmallen.me/writing/hanami-why-class-action)**
>
> Today we are going to be diving into one of my absolute favorite abstractions in all of Hanami: Actions.

---

<div class="post-metadata">

**Author:** ![alassek](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.hanakai.org/alassek/32/532_2.png) [@alassek](https://discourse.hanakai.org/u/alassek)\
**Post date:** [October 12, 2026, 6:55pm UTC](https://discourse.hanakai.org/t/hanami-why-class-action/1563/2 "2026-10-12T18:55:10Z")

</div>

> The other complaint I have heard about Hanami actions (though far less often) is around a general distaste for the more “functional” approach of `handle` and having to pass the `request` and `response` around between methods.

This is such an utterly normal way to express an HTTP handler I have a hard time imagining why someone would complain about this. Someone who’s been stuck in Rails for too long, and hasn’t poked their head out of it and looked what other people were doing.

Take, for instance, the function interface for a Go handler:

```go
func handler(w http.ResponseWriter, r *http.Request) {
    w.Header().Set("Content-Type", "text/plain")
    w.WriteHeader(http.StatusOK)
    fmt.Fprintln(w, "Hello, World!")
}

```

---

<div class="post-metadata">

**Author:** ![alassek](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.hanakai.org/alassek/32/532_2.png) [@alassek](https://discourse.hanakai.org/u/alassek)\
**Post date:** [October 12, 2026, 7:00pm UTC](https://discourse.hanakai.org/t/hanami-why-class-action/1563/3 "2026-10-12T19:00:25Z")

</div>

Anyone else remember [Focused Controller](https://jonleighton.name/2012/explaining-focused-controller/)?

edit: fixed link
