Permalink
Browse files

Update xhr_url_for.rb

Allow url_for to still be called with no parameters, just like the one we're overriding.
  • Loading branch information...
1 parent bf4932a commit c4c3e1708f38440fdc18b1523567f761f823bd27 @calvincorreli calvincorreli committed Feb 3, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/turbolinks/xhr_url_for.rb
@@ -7,7 +7,7 @@ def self.included(base)
base.alias_method_chain :url_for, :xhr_referer
end
- def url_for_with_xhr_referer(options)
+ def url_for_with_xhr_referer(options = {})
options = (xhr_referer || options) if options == :back
url_for_without_xhr_referer options
end
@@ -17,4 +17,4 @@ def xhr_referer
controller.request.headers["X-XHR-Referer"]
end
end
-end
+end

0 comments on commit c4c3e17

Please sign in to comment.