Rails Playground
A Rails playground for testing stimulus, javascript and new rails features like turbo-rails, actiontext and more.
- The stack for this application
-
-
rails 7.0
-
jssbundling-rails with esbuild
-
cssbundling-rails
-
Bootstrap 5.x
-
simple_form
-
Have fun. If you find a bug or something to improve, open an issue or create a pull request.
-
Repository: https://github.com/swobspace/rails-playground
-
Online documentation: https://swobspace.github.io/rails-playground/playbook
Rails Playground is just a collection of techniques. If you are searching for a complete tutorial with Rails 7 and Hotwire/Turbo, have a look at https://www.hotrails.dev/ |
Installation
git clone https://github.com/swobspace/rails-playground.git
rails-playground
and install dependenciescd rails-playground bundle && yarn
bin/rake db:migrate bin/rake db:seed
If you want to change the number of generated records, change db/seeds.rb
to your needs. Default is 100. You can simple run bin/rake db:seed
multiple times to get a multiple of 100 data sets.
bin/dev
Available Examples
Category | Description |
---|---|
Using a single stimulus controller for 3 different scenarios: html tables with and without buttons and for tables with server side processing (fetching data via ajax) |
|
Use turbo_stream to show flash messages as Bootstrap Alert and remove it after some animation. |
|
Use turbo_stream to show flash messages as Bootstrap Toast using default options ( |
|
Get Bootstrap v5 Modal playing nice with turbo_stream. |
|
A sortable list with Bootstrap list group and @shopify/draggable.js using turbo_stream for updates after sorting. |