Skip to content

Commit

Permalink
Document the feature
Browse files Browse the repository at this point in the history
  • Loading branch information
pablobm committed Oct 4, 2024
1 parent e79acb4 commit 0c17717
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 @@ -119,3 +119,25 @@ For example, you can add a button in the middle of the header as follows:
<%= render template: 'administrate/application/_index_header', locals: local_assigns %>
```

## 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 0c17717

Please sign in to comment.