Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions docs/0-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,46 @@ The generator adds these core files, among others:
* `app/assets/stylesheets/active_admin.scss`
* `config/initializers/active_admin.rb`

Now, migrate and seed your database before starting the server:
Now, migrate and seed your database:

```sh
rails db:migrate
rails db:seed
rails server
```

These instructions suggest using the `cssbundling-rails` and `importmap-rails`
gems for a streamlined asset management setup. However, this is not mandatory,
and you can handle asset bundling in any way that suits your needs, as long as
it works effectively.

If you haven't installed and configured `cssbundling-rails` and
`importmap-rails`, please run:

```sh
bundle add importmap-rails
rails importmap:install
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know from my upgrade experience - it's also not necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rails importmap:install is not necessary because it is being performed by rails g active_admin:install


bundle add cssbundling-rails
rails css:install:tailwind
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not necessary to install tailwind. One can run command rails css:install and it should work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, gem 'tailwindcss-rails' may not be installed

```

Install the npm package:

```sh
yarn add @activeadmin/[email protected]
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"
```

If you are already using Tailwind in your app, then update the `build:css` script
to chain the above command to your existing one, e.g. `"tailwindcss ... && tailwindcss ..."`,
so both stylesheets are generated.

Now you can start the server and the CSS builder:

```sh
bin/dev
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for those who doesn't have Procfile.dev you should give another option:

yarn build:css 
rails s


Visit `http://localhost:3000/admin` and log in as the default user:

* __User__: [email protected]
Expand Down