Skip to content

Commit

Permalink
Avoid a deprecation warning in Rails 4.2
Browse files Browse the repository at this point in the history
The deprecation is triggered by passing string keys for controller or
action to the url helper.
  • Loading branch information
jcoyne committed Dec 22, 2014
1 parent d454ab7 commit 0d4c78a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/views/catalog/index.rss.builder
Expand Up @@ -4,7 +4,7 @@ xml.rss(:version=>"2.0") {
xml.channel {

xml.title(t('blacklight.search.title', :application_name => application_name))
xml.link(catalog_index_url(params))
xml.link(search_action_url(params))
xml.description(t('blacklight.search.title', :application_name => application_name))
xml.language('en-us')
@document_list.each do |doc|
Expand Down
7 changes: 4 additions & 3 deletions lib/blacklight/controller.rb
Expand Up @@ -40,14 +40,15 @@ def default_catalog_controller
def blacklight_config
default_catalog_controller.blacklight_config
end

protected

# Default route to the search action (used e.g. in global partials). Override this method
# in a controller or in your ApplicationController to introduce custom logic for choosing
# which action the search form should use
def search_action_url *args
catalog_index_url *args
def search_action_url options = {}
# Rails 4.2 deprecated url helpers accepting string keys for 'controller' or 'action'
catalog_index_url(options.except(:controller, :action))
end

def search_action_path *args
Expand Down

0 comments on commit 0d4c78a

Please sign in to comment.