Class: Pageflow::Generators::ActiveAdminInitializerGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/pageflow/active_admin_initializer/active_admin_initializer_generator.rb

Instance Method Summary collapse

Instance Method Details

#configure_active_adminObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/generators/pageflow/active_admin_initializer/active_admin_initializer_generator.rb', line 6

def configure_active_admin
  inject_into_file 'config/initializers/active_admin.rb', after: "ActiveAdmin.setup do |config|\n" do
    "  Pageflow.active_admin_settings(config)\n\n  config.namespace :admin do |admin|\n    # Place a user user profile button next to the sign out link.\n    admin.build_menu :utility_navigation do |menu|\nmenu.add(:label => proc { display_name current_active_admin_user },\n         :id => 'current_user',\n         :if => proc { current_active_admin_user? },\n         :url => '/admin/users/me')\nadmin.add_logout_button_to_menu(menu)\n    end\n  end\n"
  end
end