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

8000
Skip to content

Commit 8b381a9

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 8b381a9

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

docs/0-installation.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,45 @@ 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.
61+
62+
If you haven't installed and configured `cssbundling-rails` and
63+
`importmap-rails`, please run:
64+
65+
```sh
66+
bundle add importmap-rails
67+
rails importmap:install
68+
69+
bundle add cssbundling-rails
70+
rails css:install:tailwind
71+
```
72+
73+
Install the npm package:
74+
75+
```sh
76+
yarn add @activeadmin/activeadmin@4.0.0-beta13
77+
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"
78+
```
79+
80+
If you are already using Tailwind in your app, then update the `build:css` script
81+
to chain the above command to your existing one, e.g. `"tailwindcss ... && tailwindcss ..."`,
82+
so both stylesheets are generated.
83+
84+
Now you can start the server and the CSS builder:
85+
86+
```sh
87+
bin/dev
88+
```
89+
5990
Visit `http://localhost:3000/admin` and log in as the default user:
6091

6192
* __User__: admin@example.com

0 commit comments

Comments
 (0)
0