Module: ActiveAdmin::AssetRegistration

Included in:
Application
Defined in:
lib/active_admin/asset_registration.rb

Instance Method Summary collapse

Instance Method Details

#clear_javascripts!Object



32
33
34
# File 'lib/active_admin/asset_registration.rb', line 32

def clear_javascripts!
  javascripts.clear
end

#clear_stylesheets!Object



16
17
18
# File 'lib/active_admin/asset_registration.rb', line 16

def clear_stylesheets!
  stylesheets.clear
end

#javascriptsObject



28
29
30
# File 'lib/active_admin/asset_registration.rb', line 28

def javascripts
  @javascripts ||= Set.new
end

#register_javascript(name) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/active_admin/asset_registration.rb', line 20

def register_javascript(name)
  Deprecation.warn <<-MSG.strip_heredoc
    The `register_javascript` config is deprecated and will be removed
    in v2. Import your "#{name}" javascript in the active_admin.js.
  MSG
  javascripts.add name
end

#register_stylesheet(path, options = {}) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/active_admin/asset_registration.rb', line 4

def register_stylesheet(path, options = {})
  Deprecation.warn <<-MSG.strip_heredoc
    The `register_stylesheet` config is deprecated and will be removed
    in v2. Import your "#{path}" stylesheet in the active_admin.scss.
  MSG
  stylesheets[path] = options
end

#stylesheetsObject



12
13
14
# File 'lib/active_admin/asset_registration.rb', line 12

def stylesheets
  @stylesheets ||= {}
end