-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
bundle add cssbundling-rails | ||
rails css:install:tailwind | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not necessary to install tailwind. One can run command There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
|
||
|
||
Visit `http://localhost:3000/admin` and log in as the default user: | ||
|
||
* __User__: admin@example.com | ||
|
There was a problem hiding this comment.
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
andimportmap-rails