From ruby-on-rails
Guidance for integrating JavaScript in Rails: import maps, jsbundling-rails (Bun/esbuild/Rollup/Webpack), Turbo helpers, request.js, and UJS replacements. Use when the user asks about JavaScript setup, bundlers, or client-side behavior in Rails.
npx claudepluginhub bastos/ruby-plugin-marketplace --plugin ruby-on-railsThis skill uses the workspace's default tool permissions.
Guide Rails applications through JavaScript setup, bundling choices, and
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Guide Rails applications through JavaScript setup, bundling choices, and Turbo/UJS replacements using Rails 7+ conventions.
bin/rails server.jsbundling-rails.bin/dev during development.Install (existing apps):
bundle add importmap-rails
bin/rails importmap:install
Pin packages:
bin/importmap pin react react-dom
Import in app/javascript/application.js:
import React from "react"
import ReactDOM from "react-dom"
Common files:
config/importmap.rbapp/javascript/application.jsCreate a new app with a bundler:
rails new my_app --javascript=bun
Available options:
bunesbuildrollupwebpackUse Turbo helpers and data attributes instead of Rails UJS:
Method override:
<%= link_to "Delete", post_path(@post), data: { turbo_method: "delete" } %>
Confirmations:
<%= link_to "Delete", post_path(@post), data: { turbo_confirm: "Are you sure?" } %>
Prefer button_to for non-GET actions when possible.
Non-GET requests require X-CSRF-Token. Rails Request.JS handles this:
import { FetchRequest } from "@rails/request.js"
const request = new FetchRequest("post", "/posts", {
body: JSON.stringify({ post: { title: "Hello" } })
})
await request.perform()