Use ActionDispatch::Routing instead of deprecated ActionController::Routing
Fix valid_format? with new rails versions