Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module RouteSpy
- def matches?(request)
- if response = super(request)
- File.open(Rails.root.join('tmp', 'default_route.txt').to_s, 'a') do |file|
- file.write(request.inspect)
- end
- response
- else
- false
- end
- end
- end
- default_route = Rails.application.routes.set.detect do |route|
- route.ast.to_s == '/:controller(/:action(/:id))(.:format)'
- end
- default_route.singleton_class.prepend(RouteSpy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement