Skip to content

Commit

Permalink
Catalog#additional_response_formats should be a protected method as i…
Browse files Browse the repository at this point in the history
…t's not routable
  • Loading branch information
jcoyne committed Feb 11, 2014
1 parent ac434f2 commit 47987ab
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions lib/blacklight/catalog.rb
Expand Up @@ -34,25 +34,6 @@ def index
additional_response_formats(format)
end
end

def additional_response_formats format
blacklight_config.index.respond_to.each do |key, config|
format.send key do
case config
when false
raise ActionController::RoutingError.new('Not Found')
when Hash
render config
when Proc
instance_exec &config
when Symbol, String
send config
else
# no-op, just render the page
end
end
end
end

# get single document from the solr index
def show
Expand Down Expand Up @@ -169,6 +150,25 @@ def sms
# non-routable methods ->
#

def additional_response_formats format
blacklight_config.index.respond_to.each do |key, config|
format.send key do
case config
when false
raise ActionController::RoutingError.new('Not Found')
when Hash
render config
when Proc
instance_exec &config
when Symbol, String
send config
else
# no-op, just render the page
end
end
end
end

# override this method to change the JSON response from #index
def render_search_results_as_json
{response: {docs: @document_list, facets: search_facets_as_json, pages: pagination_info(@response)}}
Expand Down

0 comments on commit 47987ab

Please sign in to comment.