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.
Guides Rails JavaScript setup with import maps, bundlers, Turbo helpers, and request.js for CSRF-safe Ajax.
npx claudepluginhub bastos/ruby-plugin-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
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()
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.