Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hypertext on Rails — HATEOAS が示す Rails の正しさ

Hypertext on Rails — HATEOAS が示す Rails の正しさ

Kaigi on Rails 2026

HIGASHI Taiju

October 17, 2026

Transcript

34 slides
  1. Taiju HIGASHI Works at ESM, Inc Ruby/Rails: ~4 years Rails

    7 was my first Rails fukui.rb organizer 北陸Ruby会議 staff
  2. Uniform Interface REST is defined by four interface constraints: identification

    of resources; manipulation of resources through representations; selfdescriptive messages; and, hypermedia as the engine of application state. https://ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm
  3. REST APIs must be hypertext-driven if the engine of application

    state (and hence the API) is not being driven by hypertext, then it cannot be RESTful and cannot be a REST API. Period. Is there some broken manual somewhere that needs to be fixed? https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
  4. hypertext-driven The client knows only the entrypoint The server offers

    available actions through hypertext (hypermedia) The client chooses and follows
  5. The entrypoint GET / 302 Found Location: /days/<today> GET /days/<today>

    Which one? <form action=”/days/<today>/divination” ... <a href=”/” ... <a href=”/days/<yesterday>” ...
  6. POST /days/<today>/divination/lines 303 See Other Location: /days/<today>/hexagram GET /days/<today>/hexagram Which

    one? <a href=”/days/<today>/resulting_hexagram” ... <a href=”/days/<today>/reflections” ... <a href=”/” ... <a href=”/days/<yesterday>” ...
  7. How we built new feature (Reflections feature) What can users

    do? View reflections as a timeline Post a reflection Delete a reflection When is it available? Once the hexagram is available Post and delete today only Where is it offered? Linked from the hexagram page Post and delete offered on the reflections timeline
  8. Client-driven SPA User Client “Give me the final line.” “Your

    hexagram is complete, so Reflections is available. Which one?” “Reflections.” “Since it’s today, you can post or delete. Which one?” Server “Give them the final line.” “Here’s the new state.” “Give them their reflections.” “Here’s the data.”

Other Decks in Programming