Created
October 7, 2012 00:46
-
-
Save erez-rabih/3846673 to your computer and use it in GitHub Desktop.
Filtering ajax best solution
This file contains 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
# routes.rb | |
class OnlyAjaxRequest | |
def matches?(request) | |
request.xhr? | |
end | |
end | |
match 'posts/filter/:by_attribute/:value' => 'posts#filter', :constraints => OnlyAjaxRequest.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment