Created
January 19, 2012 17:52
-
-
Save samvincent/1641438 to your computer and use it in GitHub Desktop.
Remove download links from index
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveAdmin | |
module Views | |
module Pages | |
class Index < Base | |
protected | |
def render_index | |
renderer_class = find_index_renderer_class(config[:as]) | |
paginated_collection(collection, :entry_name => active_admin_config.resource_name, :download_links => false) do | |
div :class => 'index_content' do | |
insert_tag(renderer_class, config, collection) | |
end | |
end | |
end | |
end | |
end | |
end | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveAdmin | |
class ResourceController # < ::InheritedResources::Base | |
# Since we are shipping ActiveAdmin to clients, we don't want to expose | |
# all of the freebie :csv, :json, :xml endpoints that ActiveAdmin::ResourceController | |
# has set by default | |
# | |
# Check actionpack-3.0.9/lib/action_controller/metal/mime_responds.rb for api | |
# | |
clear_respond_to | |
respond_to :html | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lukeroberts1990 and I just figured this out. To disable the CSV entirely the easiest thing to do is wrap the ActiveAdmin routes in a format constraint.