Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable filters on index page #257

Closed
okliv opened this issue Jul 5, 2011 · 20 comments
Closed

disable filters on index page #257

okliv opened this issue Jul 5, 2011 · 20 comments

Comments

@okliv
Copy link

okliv commented Jul 5, 2011

is it possible to disable filters on index page at all? i need to use all width of page to show items table

something like:

index do

filters false

...

end

@okliv
Copy link
Author

okliv commented Jul 13, 2011

any suggestions? help, please! )

@okliv okliv closed this as completed Jul 13, 2011
@okliv okliv reopened this Jul 13, 2011
@gregbell
Copy link
Contributor

Hey @okliv,

You can skip the sidebar rendering by calling the skip_sidebar! method in a before filter. Example:

ActiveAdmin.register Post do
   before_filter :skip_sidebar!, :only => :index
end

That should solve your issue.

@phillyslick
Copy link

Can anyone confirm that this doesn't work anymore?

@okliv
Copy link
Author

okliv commented Sep 26, 2011

anymore since when?

@kassio
Copy link

kassio commented Sep 28, 2011

This doesn't work to me..
return this:

NameError in Admin::CompaniesController#index

undefined local variable or method `skip_sidebar' for #Admin::CompaniesController:0x007f6ed80a2c58

My companies.rb:

ActiveAdmin.register Company do
menu label: "Company"
before_filter :skip_sidebar, :only => :index

index as: :block do |company|
div for: company do
div do
h1 company.name
h6 'email'
span company.email
h6 'phone'
span company.phone
h6 'address'
pre company.address
end
pre company.about_us
end
end
end

@acurley
Copy link

acurley commented Oct 3, 2011

This no longer works for me either. I get an "undefined method" error.

@holden
Copy link

holden commented Oct 7, 2011

It doesn't work 0.32 "undefined method `skip_sidebar!'"

@ghost
Copy link

ghost commented Oct 17, 2011

anyone news?

filter false would be great!

@andrewroth
Copy link

try

before_filter :only => :index do @skip_sidebar = true end

@jpmckinney
Copy link
Contributor

ActiveAdmin.register Post do
  before_filter :skip_sidebar!, :only => :index
end

doesn't work: undefined methodskip_sidebar!'`

@jpmckinney
Copy link
Contributor

ActiveAdmin.register Post do
  controller.skip_sidebar!
end

gives same error.

controller.helpers.skip_sidebar! doesn't cause an error, but it also has no effect.

@jpmckinney
Copy link
Contributor

Fixed in pull request #1454

@tinynumbers
Copy link
Contributor

By the way, just to answer the original question way up there at the top of this issue - "is it possible to disable filters on index page at all?" - the correct answer is to set config.filters = false in your resource registration, e.g.:


ActiveAdmin.register Post do
  ...
  config.filters = false
  ...
end

@bishma-stornelli
Copy link

I get undefined method `filters=' for #ActiveAdmin::Resource:0x00000004d69e40 with version 0.4.4 and my resource file is:

ActiveAdmin.register Client do
  actions :all, except: [:show]
  config.filters = false
end

@jpmckinney
Copy link
Contributor

You need version 0.5.0.

@chetan-alef
Copy link

From the docs

config.filters = false

@agiratech-amit
Copy link

config.filters = false

Works for me.

Thanks @chetan-alef

@ptiforka
Copy link

ptiforka commented Apr 3, 2020

ActiveAdmin.register Post do
  before_action :skip_sidebar!, only: :index
  ...
end

rails 5
ruby 2.4

@tbohr
Copy link

tbohr commented Apr 29, 2020

@

ActiveAdmin.register Post do
  before_action :skip_sidebar!, only: :index
  ...
end

rails 5
ruby 2.4

yes this is working / with conditions:

before_action :skip_sidebar!, only: :index, if: proc{ current_admin_user.is_admin? }

@KapilDevPal
Copy link

KapilDevPal commented Sep 26, 2024

config.filters = false
This Worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests