Guest User

Untitled

a guest
Jan 13th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. # in spec/routing/search_routing_spec.rb
  2.  
  3. it "routes /search/users/foo/bar to search#users with name => foo, server => bar" do
  4. { :get => '/search/users/foo/bar' }.should route_to(
  5. :controller => "search",
  6. :action => "users",
  7. :name => "foo",
  8. :server => "bar"
  9. )
  10. end
  11.  
  12. # in routes.rb
  13.  
  14. get '/search/users/:name(/:server)' => 'search#users', :constraints => {
  15. :name => /[^\/]+/,
  16. :server => /[^\/]+/
  17. }
Add Comment
Please, Sign In to add comment