Sha256: 6dab1dfc771a9058611914df649f3158b9a3018c43cd3a78748d09a847bf449c
Contents?: true
Size: 961 Bytes
Versions: 3
Compression:
Stored size: 961 Bytes
Contents
module AdminHelpers def self.jobs_url url = ["/"] if ActiveAdmin.application.default_namespace.present? url << "#{ActiveAdmin.application.default_namespace}/" end url << "jobs" url.join("") end end ActiveAdmin.setup do |config| config.load_paths += [File.join(ActiveadminJobs::Engine.root, "app", "admin")] end class ActiveAdmin::Views::Pages::Base alias_method :original_add_classes_to_body, :add_classes_to_body def add_classes_to_body original_add_classes_to_body current_user_method = ActiveAdmin.application.current_user_method if current_user_method admins_job_identifier = send(current_user_method).job_identifier @body.set_attribute "data-identifier", admins_job_identifier @body.set_attribute "data-root-url", "/" @body.set_attribute "data-jobs-url", AdminHelpers.jobs_url @body.set_attribute "data-translations", I18nDictionary.translations.to_json end end end
Version data entries
3 entries across 3 versions & 1 rubygems