Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Merge requests
  • !573

Add engine class methods for registering assets

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge flexible-assets into master May 10, 2016
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 3

Created by: gracewashere

See https://github.com/thoughtbot/administrate/issues/566

Problem:

When developing a plugin for Administrate, there is not a good way to define custom javascripts or stylesheets to be included on admin pages.

Existing solutions either use content_for at the field level, or require the end user to override Administrate's javascript partial.

Solution:

Add methods to Administrate::Engine to keep track of the assets that need to be loaded on each admin page.

Plugin developers can now use these helpers in their engine definition:

Administrate::Engine.add_javascript "my_plugin/script"
Administrate::Engine.add_stylesheet "my_plugin/styles"
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: flexible-assets