Rod McLaughlin


Problems with trying to add optional routes to the 'routesfordummies' gem (28 jan 13)

I had a phone interview with a potential employer's "technical guy". He said my gem, routesfordummies, doesn't need to draw 25 routes like this:

get "controller/a:" => 'controller#action'
get "controller/a:/b:" => 'controller#action'

etc.

Instead, he said I could do it all in one route with 'optional parameters' in parentheses, like this:

get "controller/(:a)/(:b)/(:c)/(:d)/(:e)/(:f)/(:g)" etc. => 'controller/action'

He was wrong. Doing it that way makes the application unusably slow.

See

https://github.com/pdxrod/routesfordummies/blob/master/spec/rockonruby/test/integration/get_test.rb



Back
Portland London