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

Thinking in Inertia + Rails

Thinking in Inertia + Rails

Slides from the Inertia Rails workshop at the 2025 SFRuby conference.

The demo application has open Pull Requests for the advanced features we presented (and some that we didn't have time to present!)

Avatar for Brian Knoles

Brian Knoles

December 11, 2025

Other Decks in Programming

Transcript

  1. Agenda • Introduction ◦ Who we are ◦ What is

    Inertia? ◦ Principles for thinking in Inertia • Workshop Demo: Starting from scratch • Workshop Demo: Advanced features • Questions
  2. Who we are • Svyatoslav Kryukov ◦ Backend Engineer @

    Evil Martians ◦ Contributor since 2024 ◦ Loves coffee • Brandon Shar ◦ Staff Software Engineer @ EZCater ◦ InertiaRails author since 2019 ◦ Hates coffee, loves his dog • Brian Knoles ◦ CTO @ Bellawatt ◦ InertiaRails author since 2019 ◦ Loves his dog and his coffee
  3. Who we are - summary ☕ 🐕 Svyat ✅ ✅

    Not yet… Brandon ✅ 🚫 Brian ✅ ✅
  4. What is Inertia? • Core JS + Server adapter •

    A protocol, not a framework • Analogies ◦ Turbolinks ◦ Haml
  5. Inertia Is: • Core JS + Server adapter • A

    protocol, not a framework • Analogies ◦ Turbolinks ◦ Haml • Friendly Glue • Leave behind ◦ JSON/GraphQL API ◦ JWTs ◦ Redux/Context ◦ Client side routing ◦ Messy asset versioning
  6. InertiaRails History • 2019: Inertia.js launched • 2019: InertiaRails created

    in a hackathon • 2020-2024: Modest usage • 2024-current: Takeoff ◦ Evil Martians support in 2024 ◦ Laravel maintains JS in 2025
  7. InertiaRails History • 2019: Inertia.js launched • 2019: InertiaRails created

    in a hackathon • 2020-2024: Modest usage • 2024-current: Takeoff ◦ Evil Martians support in 2024 ◦ Laravel maintains JS in 2025 Takeaways! • Inertia is not new • Inertia is well supported
  8. Why Choose Something Else? Other options: • Rails + JSON/GraphQL

    API • Hotwire • Ember or Alpine or jQuery You: • Already have microservice APIs to build against • Want a single cross platform codebase • Really like Hotwire! ◦ Or Ember, or Alpine, or jQuery
  9. Why Choose Inertia? You: 1. Want an MVC monolith with

    a React view layer 2. Appreciate the Javascript/Typescript ecosystem and its talent pool 3. Really like React/Vue/Svelte a. Many Rails teams fall in this bucket!
  10. Thinking in Inertia 1. Just use HTTP a. Links for

    navigation; POST/PATCH/DELETE for mutation 2. Let Rails drive a. Server driven state; DBs are great at updates; routing 3. React is just the view layer a. One way data flow; fewer useEffects; local state for UI only 4. The Page is the contract a. View models
  11. Workshop Demo: Advanced Features https://github.com/inertia-rails/inertia-workshop-demo Features: • Co-existing with Rails

    view stack (Devise) • Instant Search • Deferred props • Realtime Chat • RSpec testing • Server managed meta tags • Rails driven types w/ Alba and Typelizer • Optimistic UI Updates • Saving multiple models at once • Infinite Scrolling
  12. Thinking in Inertia 1. Just use HTTP a. Links for

    navigation; POST/PATCH/DELETE for mutation 2. Let Rails drive a. Server driven state; DBs are great at updates; routing 3. React is just the view layer a. One way data flow; fewer useEffects; local state for UI only 4. The Page is the contract a. View models