Skip to content

Commit

Permalink
Document the feature
Browse files Browse the repository at this point in the history
  • Loading branch information
pablobm committed Dec 28, 2023
1 parent 02cf080 commit b28c28f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/customizing_page_views.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,25 @@ rails generate administrate:views:layout
# It only generates the sidebar partial
# -> app/views/admin/application/_navigation.html.erb
```

## Adding custom CSS and JS

You can add custom CSS and JS to Administrate. Put the files in the
appropriate folders (typically under `assets`) and point Administrate to them
using the following API, preferably in an initializer. For example, if your
files are called `admin.css` and `admin.js`:

```
/// config/initializers/administrate.rb
Administrate::Engine.add_stylesheet("admin")
Administrate::Engine.add_javascript("admin")
```

Then make sure to list them in your manifest file (Rails will helpfully remind
you of this step if you miss it):

```
/// app/assets/config/manifest.js
//= link admin.css
//= link admin.js
```

0 comments on commit b28c28f

Please sign in to comment.