Skip to content

Instantly share code, notes, and snippets.

@clalimarmo clalimarmo/routes.rb
Created Sep 15, 2015

Embed
What would you like to do?
Deep Linking with React + Flux, example Rails routes definition
class ExcludeXhr
def matches?(request)
!request.xhr?
end
end
Rails.application.routes.draw do
constraints(ExcludeXhr.new) do
root 'home#index' # home/index just renders our single page client-side app
get '*path', to: "home#index", via: :all
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.