Refactor to avoid repeated code

Hello, I've seen in code climate that the file lib/devise/rails/routes.rb has a repeated code warning.
 
I've made a little refactor to avoid it and maybe make the code a little bit cleaner.

Hope it helps!