retrospring/config/initializers/rails_admin.rb

52 lines
940 B
Ruby
Raw Normal View History

2014-12-10 17:01:59 +01:00
# workaround to get pagination right
if defined? WillPaginate
Kaminari.configure do |config|
config.page_method_name = :per_page_kaminari
end
end
RailsAdmin.config do |config|
config.main_app_name = ['justask', 'Kontrollzentrum']
## == Authentication ==
config.authenticate_with do
redirect_to main_app.root_path unless current_user.try :admin?
end
config.current_user_method(&:current_user)
config.actions do
dashboard # mandatory
index # mandatory
new
export
bulk_delete
show
edit
delete
show_in_app
## With an audit adapter, you can add:
# history_index
# history_show
end
config.included_models = %w[
Answer
Comment
Group
GroupMember
2014-12-10 17:01:59 +01:00
Inbox
Notification
2014-12-10 17:01:59 +01:00
Question
Relationship
2014-12-27 14:35:09 +01:00
Report
Service
Services::Twitter
2015-01-13 00:12:48 +01:00
Services::Tumblr
2014-12-10 17:01:59 +01:00
Smile
2015-08-25 21:10:08 +02:00
Theme
2014-12-10 17:01:59 +01:00
User
]
end