rails_admin.rb.example 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. # RailsAdmin config file. Generated on July 21, 2016 18:25
  2. # See github.com/sferik/rails_admin for more informations
  3. RailsAdmin.config do |config|
  4. ################ Global configuration ################
  5. # Set the admin name here (optional second array element will appear in red). For example:
  6. config.main_app_name = ['Admin Fohow', 'Admin']
  7. # or for a more dynamic name:
  8. # config.main_app_name = Proc.new { |controller| [Rails.application.engine_name.titleize, controller.params['action'].titleize] }
  9. # RailsAdmin may need a way to know who the current user is]
  10. config.current_user_method { current_admin_user } # auto-generated
  11. # If you want to track changes on your models:
  12. # config.audit_with :history, 'AdminUser'
  13. # Or with a PaperTrail: (you need to install it first)
  14. # config.audit_with :paper_trail, 'AdminUser'
  15. # Display empty fields in show views:
  16. # config.compact_show_view = false
  17. # Number of default rows per-page:
  18. # config.default_items_per_page = 20
  19. # Exclude specific models (keep the others):
  20. # config.excluded_models = ['AdminPermission', 'AdminRole', 'AdminUser']
  21. # Include specific models (exclude the others):
  22. # config.included_models = ['AdminPermission', 'AdminRole', 'AdminUser']
  23. # Label methods for model instances:
  24. # config.label_methods << :description # Default is [:name, :title]
  25. ################ Model configuration ################
  26. # Each model configuration can alternatively:
  27. # - stay here in a `config.model 'ModelName' do ... end` block
  28. # - go in the model definition file in a `rails_admin do ... end` block
  29. # This is your choice to make:
  30. # - This initializer is loaded once at startup (modifications will show up when restarting the application) but all RailsAdmin configuration would stay in one place.
  31. # - Models are reloaded at each request in development mode (when modified), which may smooth your RailsAdmin development workflow.
  32. # Now you probably need to tour the wiki a bit: https://github.com/sferik/rails_admin/wiki
  33. # Anyway, here is how RailsAdmin saw your application's models when you ran the initializer:
  34. ### AdminPermission ###
  35. # config.model 'AdminPermission' do
  36. # # You can copy this to a 'rails_admin do ... end' block inside your admin_permission.rb model definition
  37. # # Found associations:
  38. # configure :admin_roles, :has_and_belongs_to_many_association
  39. # # Found columns:
  40. # configure :id, :integer
  41. # configure :model, :string
  42. # configure :can, :string
  43. # # Cross-section configuration:
  44. # # object_label_method :name # Name of the method called for pretty printing an *instance* of ModelName
  45. # # label 'My model' # Name of ModelName (smartly defaults to ActiveRecord's I18n API)
  46. # # label_plural 'My models' # Same, plural
  47. # # weight 0 # Navigation priority. Bigger is higher.
  48. # # parent OtherModel # Set parent model for navigation. MyModel will be nested below. OtherModel will be on first position of the dropdown
  49. # # navigation_label # Sets dropdown entry's name in navigation. Only for parents!
  50. # # Section specific configuration:
  51. # list do
  52. # # filters [:id, :name] # Array of field names which filters should be shown by default in the table header
  53. # # items_per_page 100 # Override default_items_per_page
  54. # # sort_by :id # Sort column (default is primary key)
  55. # # sort_reverse true # Sort direction (default is true for primary key, last created first)
  56. # end
  57. # show do; end
  58. # edit do; end
  59. # export do; end
  60. # # also see the create, update, modal and nested sections, which override edit in specific cases (resp. when creating, updating, modifying from another model in a popup modal or modifying from another model nested form)
  61. # # you can override a cross-section field configuration in any section with the same syntax `configure :field_name do ... end`
  62. # # using `field` instead of `configure` will exclude all other fields and force the ordering
  63. # end
  64. ### AdminRole ###
  65. # config.model 'AdminRole' do
  66. # # You can copy this to a 'rails_admin do ... end' block inside your admin_role.rb model definition
  67. # # Found associations:
  68. # configure :admin_users, :has_and_belongs_to_many_association # Hidden
  69. # configure :admin_permissions, :has_and_belongs_to_many_association
  70. # # Found columns:
  71. # configure :id, :integer
  72. # configure :name, :string
  73. # configure :description, :text
  74. # # Cross-section configuration:
  75. # # object_label_method :name # Name of the method called for pretty printing an *instance* of ModelName
  76. # # label 'My model' # Name of ModelName (smartly defaults to ActiveRecord's I18n API)
  77. # # label_plural 'My models' # Same, plural
  78. # # weight 0 # Navigation priority. Bigger is higher.
  79. # # parent OtherModel # Set parent model for navigation. MyModel will be nested below. OtherModel will be on first position of the dropdown
  80. # # navigation_label # Sets dropdown entry's name in navigation. Only for parents!
  81. # # Section specific configuration:
  82. # list do
  83. # # filters [:id, :name] # Array of field names which filters should be shown by default in the table header
  84. # # items_per_page 100 # Override default_items_per_page
  85. # # sort_by :id # Sort column (default is primary key)
  86. # # sort_reverse true # Sort direction (default is true for primary key, last created first)
  87. # end
  88. # show do; end
  89. # edit do; end
  90. # export do; end
  91. # # also see the create, update, modal and nested sections, which override edit in specific cases (resp. when creating, updating, modifying from another model in a popup modal or modifying from another model nested form)
  92. # # you can override a cross-section field configuration in any section with the same syntax `configure :field_name do ... end`
  93. # # using `field` instead of `configure` will exclude all other fields and force the ordering
  94. # end
  95. ### AdminUser ###
  96. # config.model 'AdminUser' do
  97. # # You can copy this to a 'rails_admin do ... end' block inside your admin_user.rb model definition
  98. # # Found associations:
  99. # configure :admin_roles, :has_and_belongs_to_many_association
  100. # # Found columns:
  101. # configure :id, :integer
  102. # configure :email, :string
  103. # configure :password, :password # Hidden
  104. # configure :password_confirmation, :password # Hidden
  105. # configure :reset_password_token, :string # Hidden
  106. # configure :name, :string
  107. # configure :is_super_admin, :boolean
  108. # configure :reset_password_sent_at, :datetime
  109. # configure :remember_created_at, :datetime
  110. # configure :sign_in_count, :integer
  111. # configure :current_sign_in_at, :datetime
  112. # configure :last_sign_in_at, :datetime
  113. # configure :current_sign_in_ip, :string
  114. # configure :last_sign_in_ip, :string
  115. # configure :created_at, :datetime
  116. # configure :updated_at, :datetime
  117. # # Cross-section configuration:
  118. # # object_label_method :name # Name of the method called for pretty printing an *instance* of ModelName
  119. # # label 'My model' # Name of ModelName (smartly defaults to ActiveRecord's I18n API)
  120. # # label_plural 'My models' # Same, plural
  121. # # weight 0 # Navigation priority. Bigger is higher.
  122. # # parent OtherModel # Set parent model for navigation. MyModel will be nested below. OtherModel will be on first position of the dropdown
  123. # # navigation_label # Sets dropdown entry's name in navigation. Only for parents!
  124. # # Section specific configuration:
  125. # list do
  126. # # filters [:id, :name] # Array of field names which filters should be shown by default in the table header
  127. # # items_per_page 100 # Override default_items_per_page
  128. # # sort_by :id # Sort column (default is primary key)
  129. # # sort_reverse true # Sort direction (default is true for primary key, last created first)
  130. # end
  131. # show do; end
  132. # edit do; end
  133. # export do; end
  134. # # also see the create, update, modal and nested sections, which override edit in specific cases (resp. when creating, updating, modifying from another model in a popup modal or modifying from another model nested form)
  135. # # you can override a cross-section field configuration in any section with the same syntax `configure :field_name do ... end`
  136. # # using `field` instead of `configure` will exclude all other fields and force the ordering
  137. # end
  138. end