4

Just install active_admin in rails 7 and ruby 3.1.0

gem 'activeadmin', github: 'activeadmin/activeadmin', branch: 'master'

It add two style files. One is active_admin_old.scss and other is active_admin.css which a code like it

@tailwind base;
@tailwind components;
@tailwind utilities;

Now when i run server I get UI like it

enter image description here

If i rename active_admin_old.scss to active_admin.scsss then UI is like that

enter image description here

How can i fix it?

4
  • How do you run the dev server? You have to make sure to run the tailwind process too! If you run /bin/dev, it starts the Procfile.dev that should have the rails server process and the tailwind process Commented Oct 26, 2023 at 8:34
  • yes i do /bin/dev Commented Oct 26, 2023 at 13:34
  • Have you run rails assets:precompile? Is the import on the application.html.erbcorrect? Commented Oct 26, 2023 at 13:44
  • no i am using esbuild Commented Oct 26, 2023 at 13:45

2 Answers 2

0

It is already published activeadmin 3.1.0 in rubygems. This version is compatible with rails 7 and it seems css is working correctly, this version does not provide the tailwind css version.

In your special case I would change in your Gemfile:

gem 'activeadmin', github: 'activeadmin/activeadmin', branch: 'master'

by

gem 'activeadmin'

And execute bundle update

On a clean installation I would follow common steps adding typical gems to your Gemfile:

gem 'activeadmin'
gem 'sass-rails'
gem 'devise'
gem 'cancancan'
gem 'draper'
gem 'pundit'

And run bundle install

Sign up to request clarification or add additional context in comments.

Comments

0

I believe you need tailwind to compile and you are probably running the server with rails s

If instead you use the command bin/dev to start it up, it should display it correctly.

I was having the same issue with Rails 8 and ActiveAdmin 4. Hope it works out for you.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.