Skip to content

Instantly share code, notes, and snippets.

@carllerche
Created August 7, 2008 07:46
Show Gist options
  • Save carllerche/4359 to your computer and use it in GitHub Desktop.
Save carllerche/4359 to your computer and use it in GitHub Desktop.
it "allows wrapping of nested routes all having shared argument with PREDEFINED VALUES" do
Merb::Router.prepare do |r|
r.match(/\/?(en|es|fr|be|nl)?/).to(:language => "[1]") do |l|
l.match("/guides/:action/:id").to(:controller => "tour_guides")
end
end
route_to('/se/guides/search/stokholm').should have_route(:controller => 'tour_guides', :action => "search", :id => "stokholm", :language => nil)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment