Guest User

Untitled

a guest
Feb 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. ## Routes
  2.  
  3. map.thumbnail 'download/thumbnail/:width/:height/:filename',
  4. :controller => 'download',
  5. :action => 'thumbnail',
  6. :requirements => {
  7. :width => /\d+/,
  8. :height => /\d+/
  9. }
  10.  
  11. ## Huh?
  12.  
  13. When I try to go to <mydomain.com>/download/thumbnail/80/60/d9Ym7kkUmr24gXadaBlqsS.jpg I get the error:
  14.  
  15. Routing Error
  16.  
  17. no route found to match "/download/thumbnail/70/53/d9Ym7kkUmr24gXadaBlqsS.jpg" with {:method=>:get}
  18.  
  19. ## And it fixes with...
  20.  
  21. If I add :filename => /.+/ to the requirements hash it then works. WTH?
Add Comment
Please, Sign In to add comment