Sha256: 398b586434c2b763c93b18f841bf66e69e0dcca2811f30b697b2705fa382680f

Contents?: true

Size: 1.44 KB

Versions: 3

Compression:

Stored size: 1.44 KB

Contents

RailsAdmin.config do |config|


  ################  Global configuration  ################

  # Set the admin name here (optional second array element will appear in red). For example:
  config.main_app_name = ['Dummy', 'Admin']

  # Include specific models (exclude the others):
  config.included_models = ['Page', 'Page::Translation', 'Admin::Note', 'Admin::Note::Translation']

  ################  Actions configuration  ################

  config.actions do
     # root actions
     dashboard                     # mandatory

     # collection actions
     index                         # mandatory
     new
     #export
     #history_index
     #bulk_delete

     # member actions
     show
     edit
     delete
     #history_show
     # show_in_app
   end


  ################  Model configuration  ################

  config.model 'Page' do
    configure :translations, :globalize_tabs do
      active true # open by default
    end

    edit do
      include_fields :translations, :slug, :image
    end
  end

  config.model 'Page::Translation' do
    include_fields :locale, :title, :content
  end

  config.model 'Admin::Note' do
    configure :translations, :globalize_tabs

    edit do
      include_fields :translations
    end
  end

  config.model 'Admin::Note::Translation' do
    visible false
    configure :locale, :hidden do
      help ''
    end
    field :title do
      label 'Custom note title'
    end
    include_fields :locale, :title
  end


end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails_admin_globalize_field-1.2.0 spec/dummy/config/initializers/rails_admin.rb
rails_admin_globalize_field-1.1.0 spec/dummy/config/initializers/rails_admin.rb
rails_admin_globalize_field-1.0.0 spec/dummy/config/initializers/rails_admin.rb