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 b28b68c commit 829da14
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 the files in the
appropriate folders (typically under `assets`) and point Administrate to them
using the following API, preferably in an initializer:

```
/// config/initializers/administrate.rb
// Point Administrate to admin.css and admin.js
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 829da14

Please sign in to comment.