Skip to content

Commit

Permalink
Merge pull request #1974 from unhammer/doc-htmx-note
Browse files Browse the repository at this point in the history
htmx guide: Note the usual things to remember when adding controller
  • Loading branch information
mpscholten authored Jun 22, 2024
2 parents d9ca29f + 419efdb commit 8116e87
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Guide/htmx-and-hyperscript.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ data CounterController
deriving (Eq, Show, Data)
```

Add `parseRoute @CounterController` to the list of `instance FrontController WebApplication` in `FrontController.hs` (or you'll get a 404 on calling it), and add an `instance AutoRoute CounterController` to `Routes.hs` (or you'll get a compilation error about it not being an instance of AutoRoute).

Instead of using the `render` function, htmx routes are better used with `respondHtml` to avoid the layout being shipped as part of the response. The same function can be used for initializing the view as well as upating.

```haskell
Expand Down

0 comments on commit 8116e87

Please sign in to comment.