mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-09 23:08:05 -05:00
Use scope instead of constraints to define routes.
It works the same with rails 3 and rails 4.
This commit is contained in:
@@ -12,7 +12,9 @@ class FailureTest < ActiveSupport::TestCase
|
||||
routes = ActionDispatch::Routing::RouteSet.new
|
||||
|
||||
routes.draw do
|
||||
root to: 'foo#bar', constraints: { subdomain: 'sub' }
|
||||
scope subdomain: 'sub' do
|
||||
root to: 'foo#bar'
|
||||
end
|
||||
end
|
||||
|
||||
include routes.url_helpers
|
||||
|
||||
@@ -66,7 +66,7 @@ Rails.application.routes.draw do
|
||||
devise_for :homebase_admin, class_name: "Admin", path: "homebase"
|
||||
end
|
||||
|
||||
constraints(subdomain: 'sub') do
|
||||
scope(subdomain: 'sub') do
|
||||
devise_for :subdomain_users, class_name: "User", only: [:sessions]
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user