Routing blank instead of nil and empty

As I explained in rails/rails#12660 I discovered a problem with a numeric result from to_param, it causes an error on empty? not existing for fixnum. I replaced the 2 occurrences of the nil? || empty? test with a single one for blank?
I also added a test to show it is now working.