Sha256: e379bf36da2850a03c46c0f1566ba33beb2134fb1613e4de62078fd50114c596

Contents?: true

Size: 698 Bytes

Versions: 12

Compression:

Stored size: 698 Bytes

Contents

ActiveAdmin.register_page "Settings" do
  content do    
    # Mergin db settings objects and default values
    # from config/activaadmin_settings.yml file.

    all_settings  = {}
    ActiveadminSettings::Setting.all.each do |s|
      all_settings[s.name] = s
    end

    groups = ActiveadminSettings.groups
    groups.each do |g|
      g[:default_settings].each_key do |name|
        s = all_settings[name]
        unless s
          s = ActiveadminSettings::Setting.initiate_setting(name)
        end
        g[:settings] << s 
      end
    end

    render  :partial  => "index",
            :locals   => { :admins   => AdminUser.all,
                           :groups   => groups}
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
activeadmin-settings-0.4.4 lib/generators/activeadmin_settings/templates/admin/settings.rb
activeadmin-settings-0.4.3 lib/generators/activeadmin_settings/templates/admin/settings.rb
activeadmin-settings-0.4.2 lib/generators/activeadmin_settings/templates/admin/settings.rb
activeadmin-settings-0.4.1 lib/generators/activeadmin_settings/templates/admin/settings.rb
activeadmin-settings-0.4.0 lib/generators/activeadmin_settings/templates/admin/settings.rb
activeadmin-settings-0.3.5 lib/generators/activeadmin_settings/templates/admin/settings.rb
activeadmin-settings-0.3.4 lib/generators/activeadmin_settings/templates/admin/settings.rb
activeadmin-settings-0.3.3 lib/generators/activeadmin_settings/templates/admin/settings.rb
activeadmin-settings-0.3.2 lib/generators/activeadmin_settings/templates/admin/settings.rb
activeadmin-settings-0.3.1 lib/generators/activeadmin_settings/templates/admin/settings.rb
activeadmin-settings-0.3.0 lib/generators/activeadmin_settings/templates/admin/settings.rb
activeadmin-settings-0.2.9 lib/generators/activeadmin_settings/templates/admin/settings.rb