Guest User

Untitled

a guest
Apr 16th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. lambda { |request, params|
  2. cached_path = request.path
  3. cached_method = request.method.to_s
  4. truth = (/\/([^\/.,;?]+)(\/([^\/.,;?]+)(\/([^\/.,;?]+))?)?(\.([^\/.,;?]+))?/ =~ cached_path
  5. path1, path2, path3, path4, path5, path6, path7 = $1, $2, $3, $4, $5, $6, $7
  6. if truth
  7. # then
  8. [0, {:action => path3 || "index", :controller => path1, :id => path5, :format => path7}]
  9. else
  10. [nil, {}]
  11. end
  12. }
Add Comment
Please, Sign In to add comment