Skip to content

Admin customization

Valentin Ballestrino edited this page Apr 8, 2016 · 4 revisions

You can customize the way the admin panel behaves with the following :

Admin title

In the config initializer, just add :

config.admin_title = "Your admin title"

Adding Javascripts and Stylesheets

Para allows you to add javascripts and stylesheets to be requiered at the end of the admin.js and admin.css files.

Those files are required with the asset pipeline, so you can add requires inside, create your own directory structure, and require it in the right file. This allows you to require external scripts and stylesheets, from other gems for example.

Note: You must restart your server after creating the asset files in order to let the asset pipeline take into account your file. Once this is done, you won't need to restart your server when updating the files.

Javascript

To add scripts loaded in the main admin.js file, create a file at app/assets/javascripts/admin/app.(js|coffee) and put your scripts inside.

Stylesheets

To add stylesheets loaded in the main admin.css file, create a file at app/assets/stylesheets/admin/app.(css|scss|sass) and put your styles inside.

Forcing production compilation of your file

If the file you created isn't take into account when compiling your assets in staging / production, you can update your assets version in config/initializers/assets.rb to force the complete recompilation of your assets.

Clone this wiki locally