Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails_admin navigation hide model does not work

I have one model that I want to hide from Navigation on the left of rails_admin but it does not work. (I still want to access it, just want to hide it from the panel, so exclude does not count)

I have tried all three kind of code below but it does not work:

config.model 'Document' do
 visible false
end

from here: https://github.com/sferik/rails_admin/wiki/Navigation

As well as the code:

config.model 'Document' do
   hide_from_navigation
end

from here: http://www.verious.com/code/foca/rails_admin/

As well as the code:

config.model 'Document' do
   navigation do
      visible = false
     end
end

Can someone explain for me why ?

I have already restart the server before checking it.

Thanks!

like image 848
AgainstPIT Avatar asked Jun 03 '13 06:06

AgainstPIT


2 Answers

I solved it adding the following line of code in config/initializers/rails_admin.rb:

config.excluded_models= [Document]

Instead of:

config.excluded_models = ['Document']
like image 151
Dazt Avatar answered Oct 05 '22 18:10

Dazt


in your app/config/initializers/rails_admin.rb file you can add something like this and only include the models you want to show up in your navigation --

config.included_models = [ User, Region, Newsletter, Article ]
like image 32
Noah Davis Avatar answered Oct 05 '22 17:10

Noah Davis