Skip to content

Commit

Permalink
Merge pull request #770 from projectblacklight/protect_addtl_respns
Browse files Browse the repository at this point in the history
Catalog#additional_response_formats should be a protected method as it's...
  • Loading branch information
cbeer committed Feb 11, 2014
2 parents c6abd42 + 47987ab commit 12643e1
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions lib/blacklight/catalog.rb
Original file line number Diff line number Diff line change
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 12643e1

Please sign in to comment.