8000 Improve setup instructions by tagliala · Pull Request #8545 · activeadmin/activeadmin · GitHub
[go: up one dir, main page]

Skip to content

Improve setup instructions #8545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
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:
Copy link
@thisismydesign thisismydesign Apr 22, 2025

Choose a reason for hiding this comment

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

Yes this is necessary, but their setup might change. It's easiest to just say install and configure cssbundling-rails and importmap-rails


```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/activeadmin@4.0.0-beta13
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__: admin@example.com
Expand Down
0