rails_admin_next 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +46 -0
- data/LICENSE.md +21 -0
- data/README.md +317 -0
- data/Rakefile +25 -0
- data/app/assets/javascripts/rails_admin/custom/ui.js +1 -0
- data/app/assets/stylesheets/rails_admin/framework.css +2375 -0
- data/app/assets/stylesheets/rails_admin/skin.css +472 -0
- data/app/assets/stylesheets/rails_admin/tokens.css +281 -0
- data/app/assets/stylesheets/rails_admin.css +47 -0
- data/app/controllers/rails_admin_next/application_controller.rb +98 -0
- data/app/controllers/rails_admin_next/main_controller.rb +185 -0
- data/app/helpers/rails_admin_next/application_helper.rb +254 -0
- data/app/helpers/rails_admin_next/form_builder.rb +173 -0
- data/app/helpers/rails_admin_next/main_helper.rb +63 -0
- data/app/views/layouts/rails_admin_next/_head.html.erb +29 -0
- data/app/views/layouts/rails_admin_next/_navigation.html.erb +18 -0
- data/app/views/layouts/rails_admin_next/_secondary_navigation.html.erb +27 -0
- data/app/views/layouts/rails_admin_next/_sidebar_navigation.html.erb +6 -0
- data/app/views/layouts/rails_admin_next/application.html.erb +42 -0
- data/app/views/layouts/rails_admin_next/content.html.erb +22 -0
- data/app/views/layouts/rails_admin_next/modal.js.erb +7 -0
- data/app/views/rails_admin_next/main/_dashboard_history.html.erb +46 -0
- data/app/views/rails_admin_next/main/_delete_notice.html.erb +36 -0
- data/app/views/rails_admin_next/main/_form_action_text.html.erb +2 -0
- data/app/views/rails_admin_next/main/_form_boolean.html.erb +15 -0
- data/app/views/rails_admin_next/main/_form_colorpicker.html.erb +6 -0
- data/app/views/rails_admin_next/main/_form_datetime.html.erb +14 -0
- data/app/views/rails_admin_next/main/_form_enumeration.html.erb +26 -0
- data/app/views/rails_admin_next/main/_form_field.html.erb +2 -0
- data/app/views/rails_admin_next/main/_form_file_upload.html.erb +18 -0
- data/app/views/rails_admin_next/main/_form_filtering_multiselect.html.erb +20 -0
- data/app/views/rails_admin_next/main/_form_filtering_select.html.erb +22 -0
- data/app/views/rails_admin_next/main/_form_multiple_file_upload.html.erb +21 -0
- data/app/views/rails_admin_next/main/_form_nested_many.html.erb +20 -0
- data/app/views/rails_admin_next/main/_form_nested_one.html.erb +19 -0
- data/app/views/rails_admin_next/main/_form_polymorphic_association.html.erb +24 -0
- data/app/views/rails_admin_next/main/_form_text.html.erb +2 -0
- data/app/views/rails_admin_next/main/_pagination.html.erb +54 -0
- data/app/views/rails_admin_next/main/_submit_buttons.html.erb +26 -0
- data/app/views/rails_admin_next/main/bulk_delete.html.erb +19 -0
- data/app/views/rails_admin_next/main/dashboard.html.erb +64 -0
- data/app/views/rails_admin_next/main/delete.html.erb +21 -0
- data/app/views/rails_admin_next/main/edit.html.erb +3 -0
- data/app/views/rails_admin_next/main/export.html.erb +149 -0
- data/app/views/rails_admin_next/main/history.html.erb +80 -0
- data/app/views/rails_admin_next/main/index.html.erb +186 -0
- data/app/views/rails_admin_next/main/new.html.erb +3 -0
- data/app/views/rails_admin_next/main/show.html.erb +30 -0
- data/config/brakeman.ignore +145 -0
- data/config/importmap.rails_admin.rb +29 -0
- data/config/initializers/active_record_extensions.rb +21 -0
- data/config/locales/rails_admin_next.en.yml +158 -0
- data/config/routes.rb +14 -0
- data/lib/generators/rails_admin_next/install_generator.rb +39 -0
- data/lib/generators/rails_admin_next/templates/initializer.erb +40 -0
- data/lib/generators/rails_admin_next/utils.rb +21 -0
- data/lib/rails_admin_next/abstract_model.rb +266 -0
- data/lib/rails_admin_next/adapters/active_record/association.rb +130 -0
- data/lib/rails_admin_next/adapters/active_record/object_extension.rb +13 -0
- data/lib/rails_admin_next/adapters/active_record/property.rb +58 -0
- data/lib/rails_admin_next/adapters/active_record.rb +371 -0
- data/lib/rails_admin_next/config/actions/base.rb +160 -0
- data/lib/rails_admin_next/config/actions/bulk_delete.rb +67 -0
- data/lib/rails_admin_next/config/actions/dashboard.rb +62 -0
- data/lib/rails_admin_next/config/actions/delete.rb +58 -0
- data/lib/rails_admin_next/config/actions/edit.rb +56 -0
- data/lib/rails_admin_next/config/actions/export.rb +47 -0
- data/lib/rails_admin_next/config/actions/history_index.rb +40 -0
- data/lib/rails_admin_next/config/actions/history_show.rb +40 -0
- data/lib/rails_admin_next/config/actions/index.rb +108 -0
- data/lib/rails_admin_next/config/actions/new.rb +69 -0
- data/lib/rails_admin_next/config/actions/show.rb +36 -0
- data/lib/rails_admin_next/config/actions/show_in_app.rb +37 -0
- data/lib/rails_admin_next/config/actions.rb +122 -0
- data/lib/rails_admin_next/config/configurable.rb +107 -0
- data/lib/rails_admin_next/config/const_load_suppressor.rb +78 -0
- data/lib/rails_admin_next/config/fields/association.rb +169 -0
- data/lib/rails_admin_next/config/fields/base.rb +391 -0
- data/lib/rails_admin_next/config/fields/collection_association.rb +90 -0
- data/lib/rails_admin_next/config/fields/factories/action_text.rb +14 -0
- data/lib/rails_admin_next/config/fields/factories/active_storage.rb +34 -0
- data/lib/rails_admin_next/config/fields/factories/association.rb +32 -0
- data/lib/rails_admin_next/config/fields/factories/encrypted_password.rb +28 -0
- data/lib/rails_admin_next/config/fields/factories/enum.rb +23 -0
- data/lib/rails_admin_next/config/fields/factories/password.rb +19 -0
- data/lib/rails_admin_next/config/fields/group.rb +77 -0
- data/lib/rails_admin_next/config/fields/singular_association.rb +62 -0
- data/lib/rails_admin_next/config/fields/types/action_text.rb +20 -0
- data/lib/rails_admin_next/config/fields/types/active_record_enum.rb +62 -0
- data/lib/rails_admin_next/config/fields/types/active_storage.rb +70 -0
- data/lib/rails_admin_next/config/fields/types/all.rb +32 -0
- data/lib/rails_admin_next/config/fields/types/belongs_to_association.rb +48 -0
- data/lib/rails_admin_next/config/fields/types/boolean.rb +70 -0
- data/lib/rails_admin_next/config/fields/types/citext.rb +15 -0
- data/lib/rails_admin_next/config/fields/types/color.rb +43 -0
- data/lib/rails_admin_next/config/fields/types/date.rb +38 -0
- data/lib/rails_admin_next/config/fields/types/datetime.rb +79 -0
- data/lib/rails_admin_next/config/fields/types/decimal.rb +23 -0
- data/lib/rails_admin_next/config/fields/types/enum.rb +52 -0
- data/lib/rails_admin_next/config/fields/types/file_upload.rb +87 -0
- data/lib/rails_admin_next/config/fields/types/float.rb +23 -0
- data/lib/rails_admin_next/config/fields/types/has_and_belongs_to_many_association.rb +16 -0
- data/lib/rails_admin_next/config/fields/types/has_many_association.rb +16 -0
- data/lib/rails_admin_next/config/fields/types/has_one_association.rb +35 -0
- data/lib/rails_admin_next/config/fields/types/hidden.rb +31 -0
- data/lib/rails_admin_next/config/fields/types/inet.rb +15 -0
- data/lib/rails_admin_next/config/fields/types/integer.rb +20 -0
- data/lib/rails_admin_next/config/fields/types/json.rb +37 -0
- data/lib/rails_admin_next/config/fields/types/multiple_active_storage.rb +82 -0
- data/lib/rails_admin_next/config/fields/types/multiple_file_upload.rb +134 -0
- data/lib/rails_admin_next/config/fields/types/numeric.rb +24 -0
- data/lib/rails_admin_next/config/fields/types/password.rb +45 -0
- data/lib/rails_admin_next/config/fields/types/polymorphic_association.rb +118 -0
- data/lib/rails_admin_next/config/fields/types/serialized.rb +28 -0
- data/lib/rails_admin_next/config/fields/types/string.rb +50 -0
- data/lib/rails_admin_next/config/fields/types/string_like.rb +25 -0
- data/lib/rails_admin_next/config/fields/types/text.rb +28 -0
- data/lib/rails_admin_next/config/fields/types/time.rb +39 -0
- data/lib/rails_admin_next/config/fields/types/timestamp.rb +16 -0
- data/lib/rails_admin_next/config/fields/types/uuid.rb +15 -0
- data/lib/rails_admin_next/config/fields/types.rb +29 -0
- data/lib/rails_admin_next/config/fields.rb +88 -0
- data/lib/rails_admin_next/config/groupable.rb +20 -0
- data/lib/rails_admin_next/config/has_description.rb +14 -0
- data/lib/rails_admin_next/config/has_fields.rb +144 -0
- data/lib/rails_admin_next/config/has_groups.rb +27 -0
- data/lib/rails_admin_next/config/hideable.rb +30 -0
- data/lib/rails_admin_next/config/inspectable.rb +39 -0
- data/lib/rails_admin_next/config/lazy_model.rb +74 -0
- data/lib/rails_admin_next/config/model.rb +126 -0
- data/lib/rails_admin_next/config/proxyable/proxy.rb +42 -0
- data/lib/rails_admin_next/config/proxyable.rb +26 -0
- data/lib/rails_admin_next/config/sections/base.rb +36 -0
- data/lib/rails_admin_next/config/sections/create.rb +13 -0
- data/lib/rails_admin_next/config/sections/edit.rb +13 -0
- data/lib/rails_admin_next/config/sections/export.rb +13 -0
- data/lib/rails_admin_next/config/sections/list.rb +63 -0
- data/lib/rails_admin_next/config/sections/modal.rb +12 -0
- data/lib/rails_admin_next/config/sections/nested.rb +12 -0
- data/lib/rails_admin_next/config/sections/show.rb +12 -0
- data/lib/rails_admin_next/config/sections/update.rb +12 -0
- data/lib/rails_admin_next/config/sections.rb +39 -0
- data/lib/rails_admin_next/config.rb +436 -0
- data/lib/rails_admin_next/engine.rb +91 -0
- data/lib/rails_admin_next/extension.rb +35 -0
- data/lib/rails_admin_next/extensions/cancancan/authorization_adapter.rb +90 -0
- data/lib/rails_admin_next/extensions/cancancan.rb +5 -0
- data/lib/rails_admin_next/extensions/controller_extension.rb +8 -0
- data/lib/rails_admin_next/extensions/paper_trail/auditing_adapter.rb +192 -0
- data/lib/rails_admin_next/extensions/paper_trail.rb +5 -0
- data/lib/rails_admin_next/extensions/pundit/authorization_adapter.rb +72 -0
- data/lib/rails_admin_next/extensions/pundit.rb +5 -0
- data/lib/rails_admin_next/extensions/url_for_extension.rb +15 -0
- data/lib/rails_admin_next/icons.rb +143 -0
- data/lib/rails_admin_next/support/composite_keys_serializer.rb +15 -0
- data/lib/rails_admin_next/support/csv_converter.rb +100 -0
- data/lib/rails_admin_next/support/hash_helper.rb +31 -0
- data/lib/rails_admin_next/support/paginated_collection.rb +79 -0
- data/lib/rails_admin_next/version.rb +17 -0
- data/lib/rails_admin_next.rb +72 -0
- data/lib/tasks/rails_admin.rake +40 -0
- data/src/rails_admin/application.js +15 -0
- data/src/rails_admin/base.js +12 -0
- data/src/rails_admin/controllers/alert_controller.js +28 -0
- data/src/rails_admin/controllers/collapse_controller.js +16 -0
- data/src/rails_admin/controllers/dropdown_controller.js +110 -0
- data/src/rails_admin/controllers/feedback_controller.js +73 -0
- data/src/rails_admin/controllers/filter_box_controller.js +346 -0
- data/src/rails_admin/controllers/filtering_multiselect_controller.js +386 -0
- data/src/rails_admin/controllers/filtering_select_controller.js +509 -0
- data/src/rails_admin/controllers/index.js +31 -0
- data/src/rails_admin/controllers/modal_controller.js +142 -0
- data/src/rails_admin/controllers/nested_form_controller.js +117 -0
- data/src/rails_admin/controllers/polymorphic_controller.js +26 -0
- data/src/rails_admin/controllers/remote_form_controller.js +173 -0
- data/src/rails_admin/controllers/sidescroll_controller.js +23 -0
- data/src/rails_admin/dom-ready.js +20 -0
- data/src/rails_admin/dom.js +19 -0
- data/src/rails_admin/i18n.js +20 -0
- data/src/rails_admin/icons.js +64 -0
- data/src/rails_admin/interactions.js +221 -0
- data/src/rails_admin/select_query.js +65 -0
- metadata +346 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 41aa74e3b01539b9fc293ce040bdc60801e0d9708d22447276c88dad216d6a51
|
|
4
|
+
data.tar.gz: fa571294625b43664ae466e5c62aae7fb6e88a0c55a487562392c1670ddb4a36
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: d43b9c62e232c5a6e37fae047f4712af5021b8263fcdb22034d18dea4550bc10e7c01e8b379f39cf356279248ace2f08b22ffb3abccdc05e8975338b323c9a7c
|
|
7
|
+
data.tar.gz: 432b7fb059543a084a73b99dacf2d817c83f500bc3cc7af6335fc8c96d6883b7250f95470e4b2d9906a2677087feb8be80179658d36cc297cee9f417f553f917
|
data/Gemfile
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "net-smtp", require: false
|
|
6
|
+
gem "rails"
|
|
7
|
+
gem "turbo-rails"
|
|
8
|
+
|
|
9
|
+
group :development, :test do
|
|
10
|
+
gem "pry", ">= 0.9"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
group :test do
|
|
14
|
+
gem "brakeman", require: false
|
|
15
|
+
gem "bundler-audit", require: false
|
|
16
|
+
gem "cancancan", "~> 3.0"
|
|
17
|
+
gem "cuprite", "!= 0.15.1"
|
|
18
|
+
gem "database_cleaner-active_record", ">= 2.0", require: false
|
|
19
|
+
gem "factory_bot", ">= 4.2", "!= 6.4.5"
|
|
20
|
+
gem "generator_spec", ">= 0.8"
|
|
21
|
+
gem "image_processing", ">= 1.2"
|
|
22
|
+
gem "pundit"
|
|
23
|
+
gem "rspec-expectations", "!= 3.8.3"
|
|
24
|
+
gem "rspec-rails", ">= 4.0.0.beta2"
|
|
25
|
+
gem "rspec-retry"
|
|
26
|
+
gem "ruby-vips", ">= 2.1"
|
|
27
|
+
gem "simplecov", ">= 0.9", require: false
|
|
28
|
+
gem "simplecov-lcov", require: false
|
|
29
|
+
gem "standard", ">= 1.35.1", require: false
|
|
30
|
+
|
|
31
|
+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
|
32
|
+
gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]
|
|
33
|
+
gem "warden"
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
group :active_record do
|
|
37
|
+
gem "paper_trail", ">= 12.0"
|
|
38
|
+
|
|
39
|
+
platforms :ruby, :mswin, :mingw, :x64_mingw do
|
|
40
|
+
gem "mysql2", ">= 0.3.14"
|
|
41
|
+
gem "pg", ">= 1.0.0"
|
|
42
|
+
gem "sqlite3", ">= 1.3.0"
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
gemspec
|
data/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Copyright (c) 2010-2016 Erik Michaels-Ober
|
|
2
|
+
Copyright (c) 2026 Daniel López Prat and RailsAdminNext contributors
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
5
|
+
a copy of this software and associated documentation files (the
|
|
6
|
+
"Software"), to deal in the Software without restriction, including
|
|
7
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
8
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
9
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
10
|
+
the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be
|
|
13
|
+
included in all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
19
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
20
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
21
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# RailsAdminNext
|
|
4
|
+
|
|
5
|
+
### The modern RailsAdmin — point it at your ActiveRecord models for instant CRUD, search, filtering, export, and history.
|
|
6
|
+
|
|
7
|
+
**Rails ~> 8.1 · ActiveRecord · importmap + Propshaft · Turbo + Stimulus · zero build step**
|
|
8
|
+
|
|
9
|
+
[](https://github.com/6temes/rails_admin_next/actions/workflows/test.yml)
|
|
10
|
+
[](LICENSE.md)
|
|
11
|
+
[](https://www.ruby-lang.org)
|
|
12
|
+
[](https://rubyonrails.org)
|
|
13
|
+
|
|
14
|
+
[Why RailsAdminNext?](#why-railsadminnext) ◆ [Quick Start](#quick-start) ◆ [Installation](#installation) ◆ [Architecture](#architecture) ◆ [Security](#security) ◆ [Upgrading](#upgrading-from-railsadmin)
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
RailsAdminNext is a Rails engine that auto-generates an easy-to-use interface for managing your
|
|
19
|
+
data — a modernized hard fork of [RailsAdmin][upstream], restarted at 1.0.0 and trimmed to a single,
|
|
20
|
+
modern, zero-build stack. There is no Mongoid, no Webpack/Webpacker/Vite/Sprockets, no jQuery, and
|
|
21
|
+
no build step.
|
|
22
|
+
|
|
23
|
+
Already running RailsAdmin? See [docs/UPGRADING.md](docs/UPGRADING.md).
|
|
24
|
+
|
|
25
|
+
[upstream]: https://github.com/railsadminteam/rails_admin
|
|
26
|
+
|
|
27
|
+
## Why RailsAdminNext?
|
|
28
|
+
|
|
29
|
+
RailsAdmin gives you a full admin UI for free — but the original carries a decade of multi-ORM,
|
|
30
|
+
multi-bundler, jQuery-era machinery. RailsAdminNext keeps the admin and drops the rest:
|
|
31
|
+
|
|
32
|
+
- **⚡ Zero build step** — browser-native ESM over **importmap + Propshaft**; no Webpack/Vite/Sprockets, no `yarn build`, no generated pins.
|
|
33
|
+
- **🧩 Turbo + Stimulus** — the jQuery / jQuery-UI / Bootstrap-JS / `@rails/ujs` stack is gone, replaced by engine-shipped Stimulus controllers; styling is hand-maintained vanilla CSS.
|
|
34
|
+
- **🔒 Hardened & CDN-free** — a documented CSRF / clickjacking / mass-assignment / CSP posture ([SECURITY.md](SECURITY.md)) and **zero external CDN**, default or opt-in — every asset is self-hosted off a gem.
|
|
35
|
+
- **🎯 One modern target** — Ruby ≥ 4.0.5, Rails ~> 8.1, ActiveRecord only, latest Chrome + Safari. No Mongoid, no multi-bundler / multi-Rails matrix, no legacy-browser CSS.
|
|
36
|
+
- **↩️ Familiar** — `RailsAdminNext.config`, per-model `rails_admin_next do … end` blocks, and CanCanCan / Pundit authorization all work as before; upgrading from RailsAdmin is a mechanical rename.
|
|
37
|
+
|
|
38
|
+
## Quick Start
|
|
39
|
+
|
|
40
|
+
```ruby
|
|
41
|
+
# Gemfile
|
|
42
|
+
gem "rails_admin_next", git: "https://github.com/6temes/rails_admin_next"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
bundle install
|
|
47
|
+
bin/rails g rails_admin_next:install # mounts the engine + writes the initializer
|
|
48
|
+
bin/rails s # then open http://localhost:3000/admin
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
That's the whole setup — no `yarn add`, no asset build, no generated pins. The engine ships its own importmap and CSS.
|
|
52
|
+
|
|
53
|
+
> **Prerequisites:** Ruby ≥ 4.0.5 · Rails ~> 8.1 · ActiveRecord · a [Propshaft][propshaft] + [importmap-rails][importmap] host (both are pulled in as dependencies). See [Installation](#installation) for the full walkthrough.
|
|
54
|
+
|
|
55
|
+
## Requirements
|
|
56
|
+
|
|
57
|
+
- Ruby >= 4.0.5
|
|
58
|
+
- Rails ~> 8.1
|
|
59
|
+
- ActiveRecord (Mongoid is not supported)
|
|
60
|
+
- [Propshaft][propshaft] and [importmap-rails][importmap] (both are pulled in as
|
|
61
|
+
dependencies; RailsAdminNext serves its frontend over them, with no bundler or build step)
|
|
62
|
+
- Latest stable Chrome or Safari for the admin's users (see [Browser support](#browser-support))
|
|
63
|
+
|
|
64
|
+
[propshaft]: https://github.com/rails/propshaft
|
|
65
|
+
[importmap]: https://github.com/rails/importmap-rails
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
|
|
69
|
+
1. Add the gem to your `Gemfile`. RailsAdminNext is distributed from the fork, so point
|
|
70
|
+
at the repository with `git:`:
|
|
71
|
+
|
|
72
|
+
```ruby
|
|
73
|
+
gem "rails_admin_next", git: "https://github.com/6temes/rails_admin_next"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
2. Run `bundle install`.
|
|
77
|
+
3. Run `rails g rails_admin_next:install`.
|
|
78
|
+
4. Provide a namespace for the routes when asked (defaults to `admin`).
|
|
79
|
+
5. Start a server with `rails s` and administer your data at
|
|
80
|
+
[/admin](http://localhost:3000/admin) (or the namespace you chose).
|
|
81
|
+
|
|
82
|
+
The install generator mounts the engine, writes
|
|
83
|
+
`config/initializers/rails_admin_next.rb`, and does nothing else — the engine ships its
|
|
84
|
+
own importmap and CSS, so there is no `yarn add`, no asset build, and no generated pins.
|
|
85
|
+
|
|
86
|
+
## Features
|
|
87
|
+
|
|
88
|
+
- CRUD any data with ease
|
|
89
|
+
- Custom actions
|
|
90
|
+
- Automatic form validation
|
|
91
|
+
- Search and filtering
|
|
92
|
+
- Export data to CSV / JSON / XML
|
|
93
|
+
- File uploads (ActiveStorage)
|
|
94
|
+
- Rich text fields (ActionText / Trix)
|
|
95
|
+
- Authentication (via [Devise][devise] or any other scheme)
|
|
96
|
+
- Authorization (via [CanCanCan][cancancan] or [Pundit][pundit])
|
|
97
|
+
- User action history (via [PaperTrail][papertrail])
|
|
98
|
+
|
|
99
|
+
[devise]: https://github.com/heartcombo/devise
|
|
100
|
+
[cancancan]: https://github.com/CanCanCommunity/cancancan
|
|
101
|
+
[pundit]: https://github.com/varvet/pundit
|
|
102
|
+
[papertrail]: https://github.com/paper-trail-gem/paper_trail
|
|
103
|
+
|
|
104
|
+
## Configuration
|
|
105
|
+
|
|
106
|
+
### Global
|
|
107
|
+
|
|
108
|
+
Configure the engine in `config/initializers/rails_admin_next.rb`:
|
|
109
|
+
|
|
110
|
+
```ruby
|
|
111
|
+
RailsAdminNext.config do |config|
|
|
112
|
+
config.actions do
|
|
113
|
+
dashboard
|
|
114
|
+
index
|
|
115
|
+
new
|
|
116
|
+
export
|
|
117
|
+
bulk_delete
|
|
118
|
+
show
|
|
119
|
+
edit
|
|
120
|
+
delete
|
|
121
|
+
show_in_app
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
This is also where you wire up [Devise][devise], [CanCanCan][cancancan]/[Pundit][pundit],
|
|
127
|
+
and [PaperTrail][papertrail].
|
|
128
|
+
|
|
129
|
+
### Per model
|
|
130
|
+
|
|
131
|
+
Configure a model inline with the `rails_admin_next do … end` class macro:
|
|
132
|
+
|
|
133
|
+
```ruby
|
|
134
|
+
class Ball < ApplicationRecord
|
|
135
|
+
validates :name, presence: true
|
|
136
|
+
belongs_to :player
|
|
137
|
+
|
|
138
|
+
rails_admin_next do
|
|
139
|
+
configure :player do
|
|
140
|
+
label "Owner of this ball: "
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The configuration DSL is unchanged from upstream RailsAdmin, so the upstream
|
|
147
|
+
[wiki][wiki] is still an accurate reference for model, group, and field options.
|
|
148
|
+
|
|
149
|
+
[wiki]: https://github.com/railsadminteam/rails_admin/wiki
|
|
150
|
+
|
|
151
|
+
### Authorization keys are stable
|
|
152
|
+
|
|
153
|
+
The authorization contract is held stable, so existing CanCanCan
|
|
154
|
+
abilities and Pundit policies keep working **without edits**: the access subject is
|
|
155
|
+
`:rails_admin` and every action's
|
|
156
|
+
authorization key (`:dashboard`, `:index`, `:show`, `:new`, `:edit`, `:export`,
|
|
157
|
+
`:destroy`, `:history`, `:show_in_app`) is unchanged.
|
|
158
|
+
|
|
159
|
+
```ruby
|
|
160
|
+
# Still grants access to the admin:
|
|
161
|
+
can :access, :rails_admin
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
The `admin.*` I18n namespace is likewise unchanged.
|
|
165
|
+
|
|
166
|
+
## Frontend and assets
|
|
167
|
+
|
|
168
|
+
RailsAdminNext ships a single, zero-build asset path:
|
|
169
|
+
|
|
170
|
+
- The pipeline is **importmap + Propshaft** only.
|
|
171
|
+
- The frontend is **Turbo + Stimulus** — the engine ships its own Stimulus application
|
|
172
|
+
and controllers under `src/rails_admin/`, registered through an explicit manifest
|
|
173
|
+
(`src/rails_admin/controllers/index.js`).
|
|
174
|
+
- Styles are **hand-maintained vanilla CSS** (no Bootstrap SCSS, no build), delivered in
|
|
175
|
+
cascade layers with a design-token theming API — see
|
|
176
|
+
[Styling and theming](#styling-and-theming). Icons are inline SVG, and date/time fields
|
|
177
|
+
use native HTML5 inputs — no icon font, no date-picker library.
|
|
178
|
+
|
|
179
|
+
Compared to RailsAdmin, the following were intentionally removed:
|
|
180
|
+
|
|
181
|
+
- **Mongoid** — ActiveRecord only.
|
|
182
|
+
- **Webpack, Webpacker, Vite, and Sprockets** — importmap + Propshaft only.
|
|
183
|
+
- **jQuery, jQuery-UI, Bootstrap's JS, and `@rails/ujs`** — replaced by Stimulus controllers.
|
|
184
|
+
- **Standalone WYSIWYG/code editors** (`bootstrap-wysihtml5`, `froala`, CKEditor, CodeMirror,
|
|
185
|
+
SimpleMDE) — they loaded from a CDN; use ActionText/Trix rich text (self-hosted) or a plain
|
|
186
|
+
`:text` textarea instead.
|
|
187
|
+
- **Drag-to-reorder for multiple uploads** (it relied on jQuery-UI sortable).
|
|
188
|
+
- **flatpickr** — date/time fields use native HTML5 inputs (`type="date"`/`datetime-local`/`time`);
|
|
189
|
+
the configurable picker display format and localization are now the browser's.
|
|
190
|
+
|
|
191
|
+
### Browser support
|
|
192
|
+
|
|
193
|
+
RailsAdminNext is built as an **internal tool for teams that control their admin users'
|
|
194
|
+
browsers**: it targets the **latest stable Chrome and Safari only**, and it drops
|
|
195
|
+
legacy-browser support deliberately — it does not court general RailsAdmin migrators. The
|
|
196
|
+
engine's CSS and JS freely assume `:has()`, `<dialog>`, popovers, CSS nesting, `oklch()`,
|
|
197
|
+
`color-mix()`, `light-dark()`, and CSS anchor positioning. If your admin users are on
|
|
198
|
+
Firefox or anything older, stay on upstream RailsAdmin.
|
|
199
|
+
|
|
200
|
+
### Styling and theming
|
|
201
|
+
|
|
202
|
+
All engine CSS ships inside three cascade layers — `ra.tokens`, `ra.framework`, `ra.skin` —
|
|
203
|
+
so **any unlayered host rule beats the engine's CSS** without specificity games:
|
|
204
|
+
|
|
205
|
+
```css
|
|
206
|
+
/* a plain rule in your own stylesheet just wins */
|
|
207
|
+
.badge {
|
|
208
|
+
border-radius: 7px;
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Re-branding is one token — every derived color (button hover/active states, focus rings,
|
|
213
|
+
links, alert tints) follows automatically:
|
|
214
|
+
|
|
215
|
+
```css
|
|
216
|
+
:root {
|
|
217
|
+
--ra-primary: #663399;
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
See [docs/UPGRADING.md](docs/UPGRADING.md) for the full list of supported override tokens
|
|
222
|
+
and the `--bs-*` → `--ra-*` mapping.
|
|
223
|
+
|
|
224
|
+
### Dark mode
|
|
225
|
+
|
|
226
|
+
The admin follows the OS color-scheme preference automatically (every color token is a
|
|
227
|
+
`light-dark()` pair). The `color_scheme` config knob pins it:
|
|
228
|
+
|
|
229
|
+
```ruby
|
|
230
|
+
RailsAdminNext.config do |config|
|
|
231
|
+
config.color_scheme = :light # :auto (default) follows the OS; :light/:dark pin it
|
|
232
|
+
end
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Note for operators:** after upgrading, the admin renders dark for anyone whose OS prefers
|
|
236
|
+
dark. Pin `config.color_scheme = :light` to keep the old always-light rendering; if
|
|
237
|
+
something looks wrong in dark mode, please
|
|
238
|
+
[open an issue](https://github.com/6temes/rails_admin_next/issues).
|
|
239
|
+
|
|
240
|
+
## Architecture
|
|
241
|
+
|
|
242
|
+
RailsAdminNext is built on a handful of registries and one ORM facade: a **single controller with no
|
|
243
|
+
action methods**, where each admin operation is an object.
|
|
244
|
+
|
|
245
|
+
```text
|
|
246
|
+
Host app models (ActiveRecord)
|
|
247
|
+
│
|
|
248
|
+
RailsAdminNext.config(Model) { … } ← lazy, proxy-bound DSL
|
|
249
|
+
│ (deferred; evaluated on first access)
|
|
250
|
+
▼
|
|
251
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
252
|
+
│ Action registry — Config::Actions::Base subclasses │
|
|
253
|
+
│ dashboard · index · show · new · edit · delete · export · │
|
|
254
|
+
│ bulk_delete · history_* · show_in_app │
|
|
255
|
+
│ each carries: route scope · http_methods · template · │
|
|
256
|
+
│ authorization_key · a :controller proc (the request handler) │
|
|
257
|
+
└──────────────────────────┬───────────────────────────────────┘
|
|
258
|
+
│ routes drawn dynamically at boot
|
|
259
|
+
▼
|
|
260
|
+
RailsAdminNext::MainController (ONE controller, no actions)
|
|
261
|
+
method_missing → authorize → load @object → eval the proc
|
|
262
|
+
│
|
|
263
|
+
▼
|
|
264
|
+
RailsAdminNext::AbstractModel → Adapters::ActiveRecord
|
|
265
|
+
get · first · all · count · scoped · destroy · new
|
|
266
|
+
(StatementBuilder generates the filter/search SQL, per adapter)
|
|
267
|
+
│
|
|
268
|
+
▼
|
|
269
|
+
Views + Turbo/Stimulus (src/rails_admin/*) over importmap + Propshaft
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Key design decisions:**
|
|
273
|
+
|
|
274
|
+
- **One controller, many action objects** — to change how e.g. _edit_ behaves, edit `lib/rails_admin_next/config/actions/edit.rb`, not the controller.
|
|
275
|
+
- **ORM facade** — nothing outside `AbstractModel` references ActiveRecord directly; the adapter seam is intact even though Mongoid was removed.
|
|
276
|
+
- **Lazy, layered config** — `config/initializers` blocks run before in-model `rails_admin_next do … end` blocks, so per-model config overrides the initializer defaults.
|
|
277
|
+
- **A deliberately frozen `rails_admin` surface** — the Ruby layer is `RailsAdminNext`, but the `:access, :rails_admin` authorization subject, the `admin.*` I18n namespace, and the `src/rails_admin/` asset tree stay `rails_admin` on purpose, so host abilities, translations, and assets keep working across the rename.
|
|
278
|
+
|
|
279
|
+
## Upgrading from RailsAdmin
|
|
280
|
+
|
|
281
|
+
See [docs/UPGRADING.md](docs/UPGRADING.md) for the one-time changes a host app needs:
|
|
282
|
+
the Gemfile gem name, the importmap/Propshaft prerequisites, and a mechanical rename of the
|
|
283
|
+
`RailsAdmin` constant, initializer, mount, model macro, and route helpers to `RailsAdminNext`
|
|
284
|
+
(`rails_admin_next`). The `:access, :rails_admin` authorization subject and the `admin.*`
|
|
285
|
+
I18n namespace are deliberately left unchanged, so CanCanCan/Pundit rules and translations
|
|
286
|
+
keep working without edits.
|
|
287
|
+
|
|
288
|
+
## Security
|
|
289
|
+
|
|
290
|
+
For supported versions, private vulnerability reporting, the automated scanning gates,
|
|
291
|
+
and the manual importmap-pin audit cadence, see [SECURITY.md](SECURITY.md). The admin's
|
|
292
|
+
request-forgery, clickjacking, export, mass-assignment, and Content-Security-Policy
|
|
293
|
+
posture is documented in [docs/security.md](docs/security.md).
|
|
294
|
+
|
|
295
|
+
## Contributing
|
|
296
|
+
|
|
297
|
+
Bug reports and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for the
|
|
298
|
+
development setup and how to run the test suite. If you think you found a bug, please
|
|
299
|
+
[open an issue](https://github.com/6temes/rails_admin_next/issues/new).
|
|
300
|
+
|
|
301
|
+
## Credits
|
|
302
|
+
|
|
303
|
+
This project is a hard fork of the original [RailsAdmin][upstream], created by
|
|
304
|
+
Erik Michaels-Ober, Bogdan Gaza, Petteri Kääpä, Benoit Bénézech, Mitsuhiro Shibuya, and the
|
|
305
|
+
many contributors who built and maintained it for over a decade. It stands entirely on their
|
|
306
|
+
work. This fork is independent and is not affiliated with or endorsed by the RailsAdmin
|
|
307
|
+
maintainers.
|
|
308
|
+
|
|
309
|
+
## License
|
|
310
|
+
|
|
311
|
+
RailsAdminNext is released under the [MIT License](LICENSE.md).
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
<div align="center">
|
|
316
|
+
<sub>Built in Tokyo with ❤️ and 🤖</sub>
|
|
317
|
+
</div>
|
data/Rakefile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
|
4
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
|
5
|
+
|
|
6
|
+
Dir["lib/tasks/*.rake"].each { |rake| load rake }
|
|
7
|
+
|
|
8
|
+
require "bundler"
|
|
9
|
+
Bundler::GemHelper.install_tasks
|
|
10
|
+
|
|
11
|
+
require "rspec/core/rake_task"
|
|
12
|
+
RSpec::Core::RakeTask.new(:spec)
|
|
13
|
+
|
|
14
|
+
task test: :spec
|
|
15
|
+
|
|
16
|
+
begin
|
|
17
|
+
require "standard/rake"
|
|
18
|
+
rescue LoadError
|
|
19
|
+
desc "Run Standard"
|
|
20
|
+
task :standard do
|
|
21
|
+
warn "Standard is disabled"
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
task default: %i[spec standard]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// override this file in your application to add custom behaviour
|