Skip to content

Instantly share code, notes, and snippets.

@phlco
Created November 26, 2013 21:14
Show Gist options
  • Select an option

  • Save phlco/7666381 to your computer and use it in GitHub Desktop.

Select an option

Save phlco/7666381 to your computer and use it in GitHub Desktop.
class XHRConstraint
def matches?(request)
!request.xhr? && !(request.url =~ /\.json$/ && ::Rails.env == 'development')
end
end
match '(*url)' => 'home#index', :constraints => XHRConstraint.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment