Skip to content

Instantly share code, notes, and snippets.

@paul
Created November 24, 2008 22:26
Show Gist options
  • Save paul/28656 to your computer and use it in GitHub Desktop.
Save paul/28656 to your computer and use it in GitHub Desktop.
match('/templates').
to(:controller => 'templates', :action => 'index').
name(:templates)
match('/templates/:id', :id => /.+/).
to(:controller => 'templates', :action => 'show').
name(:template)
# TODO Use this instead once carllerche fixes the route generation order
# resources :templates, :id => /.+/ do
# resources :questions, :keys => :name, :name => /.+/
# end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment