Skip to content

Releases: jacksonpires/ruby_ui_scaffold

v0.1.0

10 Jun 12:52

Choose a tag to compare

First release 🎉

A Rails scaffold generator that outputs Phlex views wired to ruby_ui components — a drop-in alternative to rails g scaffold — plus a smart seed command to populate models with fake data.

Highlights

Scaffold generatorbin/rails g ruby_ui_scaffold Buddy name:string email:string admin:boolean bio:text birthday:date

  • Generates the model, migration, controller, routes, tests, and Phlex view classes (index, show, new, edit, form) under the Views:: namespace.
  • Type-aware form inputs: Input, Textarea, Checkbox, DatePicker (dates), file inputs, and Combobox/Select for belongs_to references.
  • Index with an action DropdownMenu (Show / Edit / Delete), AlertDialog delete confirmation (no JS confirm), boolean Badges, and truncating cells.
  • New/Edit forms with a Back link (returns to request.referer) and Lucide icons on the action buttons.

Flags

  • --datatable — DataTable index (search, per-page, sortable headers, pagination) plus the matching controller.
  • --literal — emit views with literal prop macros.
  • --phlex-layout=ClassName — wrap every view in a Phlex layout.
  • --skip-model — re-run against an existing model (regenerate only the controller, views, and route).
  • --skip-install — opt out of automatic setup.

One-command setupbin/rails g ruby_ui_scaffold:install

  • Idempotent: bootstraps the ruby_ui gem, runs phlex:install / ruby_ui:install, and installs the base components. Column/flag-specific components are installed on demand per scaffold, so your app only carries what it actually uses.

Seed commandbin/rails ruby_ui_scaffold:seed Buddy --count 50

  • Realistic fake data via Faker, with smart inference (belongs_to foreign keys, enums, validations, and column-name heuristics).

Install

# Gemfile
gem "ruby_ui", github: "ruby-ui/ruby_ui", branch: "main", require: false

group :development do
  gem "ruby_ui_scaffold"
end
bundle install
bin/rails g ruby_ui_scaffold:install

Requires Rails 7.1+ and a Tailwind CSS setup.

Docs

See the README for the full guide and the CHANGELOG for the complete list of changes.