Skip to content

Instantly share code, notes, and snippets.

@clalimarmo
Created September 15, 2015 16:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clalimarmo/6d8cefaa339353dc40bf to your computer and use it in GitHub Desktop.
Save clalimarmo/6d8cefaa339353dc40bf to your computer and use it in GitHub Desktop.
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