8000 Improve setup instructions · activeadmin/activeadmin@ae6eeba · GitHub
[go: up one dir, main page]

Skip to content

Commit ae6eeba

Browse files
committed
Improve setup instructions
- Separate database setup from server startup and clarifies asset handling process - Copy `cssbundling-rails` instructions from the Upgrading guide as a recommended approach for managing Tailwind CSS assets - Suggest starting the server with `bin/dev` to handle both web and CSS building process Ref: #8538 [ci skip]
1 parent 276c9bf commit ae6eeba

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

docs/0-installation.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,46 @@ The generator adds these core files, among others:
4848
* `app/assets/stylesheets/active_admin.scss`
4949
* `config/initializers/active_admin.rb`
5050

51-
Now, migrate and seed your database before starting the server:
51+
Now, migrate and seed your database:
5252

5353
```sh
5454
rails db:migrate
5555
rails db:seed
56-
rails server
5756
```
5857

58+
These instructions suggest using the `cssbundling-rails` and `importmap-rails`
59+
gems for a streamlined asset management setup. However, this is not mandatory,
60+
and you can handle asset bundling in any way that suits your needs, as long as
61+
it works effectively.
62+
63+
If you haven't installed and configured `cssbundling-rails` and
64+
`importmap-rails`, please run:
65+
66+
```sh
67+
bundle add importmap-rails
68+
rails importmap:install
69+
70+
bundle add cssbundling-rails
71+
rails css:install:tailwind
72+
```
73+
74+
Install the npm package:
75+
76+
```sh
77+
yarn add @activeadmin/activeadmin@4.0.0-beta13
78+
npm pkg set scripts.build:css="tailwindcss -i ./app/assets/stylesheets/active_admin.css -o ./app/assets/builds/active_admin.css --minify -c tailwind-active_admin.config.js"
79+
```
80+
81+
If you are already using Tailwind in your app, then update the `build:css` script
82+
to chain the above command to your existing one, e.g. `"tailwindcss ... && tailwindcss ..."`,
83+
so both stylesheets are generated.
84+
85+
Now you can start the server and the CSS builder:
86+
87+
```sh
88+
bin/dev
89+
```
90+
5991
Visit `http://localhost:3000/admin` and log in as the default user:
6092

6193
* __User__: admin@example.com

0 commit comments

Comments
 (0)
0