Skip to content

Instantly share code, notes, and snippets.

View ests's full-sized avatar

Ernest ests

  • IesT
  • EU
View GitHub Profile

Based on the documentation I've reviewed, I can provide you with a comprehensive answer about Stimulus.js and its suitability for working with JSON vs HTML partials in Rails applications.

Stimulus.js Philosophy: HTML-First Approach

Stimulus.js is designed around the "HTML-first" philosophy, which aligns perfectly with the traditional Rails way. Here's what this means for your JSON vs HTML partials question:

HTML Partials (The Rails Way) - Recommended

Stimulus.js works exceptionally well with HTML partials and server-rendered content: