Permalink
Browse files

Change match routes to get / post

match without a verb is deprecated in Rails master.
  • Loading branch information...
1 parent 86eecc6 commit af37800c1dc444d6c6615143fcccdc040cec224b @carlosantoniodasilva carlosantoniodasilva committed Jan 23, 2013
Showing with 19 additions and 17 deletions.
  1. +1 −1 app/controllers/devise_controller.rb
  2. +5 −3 lib/devise/rails/routes.rb
  3. +13 −13 test/rails_app/config/routes.rb
@@ -67,7 +67,7 @@ def assert_is_devise_resource! #:nodoc:
1) You forgot to wrap your route inside the scope block. For example:
devise_scope :user do
- match "/some/route" => "some_devise_controller"
+ get "/some/route" => "some_devise_controller"
end
2) You are testing a Devise controller bypassing the router.
@@ -329,7 +329,7 @@ def unauthenticated(scope=nil)
# good and working example.
#
# devise_scope :user do
- # match "/some/route" => "some_devise_controller"
+ # get "/some/route" => "some_devise_controller"
# end
# devise_for :users
#
@@ -401,12 +401,14 @@ def devise_omniauth_callback(mapping, controllers) #:nodoc:
match "#{path_prefix}/:provider",
:constraints => { :provider => providers },
:to => "#{controllers[:omniauth_callbacks]}#passthru",
- :as => :omniauth_authorize
+ :as => :omniauth_authorize,
+ :via => [:get, :post]
match "#{path_prefix}/:action/callback",
:constraints => { :action => providers },
:to => controllers[:omniauth_callbacks],
- :as => :omniauth_callback
+ :as => :omniauth_callback,
+ :via => [:get, :post]
ensure
@scope[:path] = path
end
@@ -17,39 +17,39 @@
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
as :user do
- match "/as/sign_in", :to => "devise/sessions#new"
+ get "/as/sign_in", :to => "devise/sessions#new"
end
- match "/sign_in", :to => "devise/sessions#new"
+ get "/sign_in", :to => "devise/sessions#new"
# Admin scope
devise_for :admin, :path => "admin_area", :controllers => { :sessions => :"admins/sessions" }, :skip => :passwords
- match "/admin_area/home", :to => "admins#index", :as => :admin_root
- match "/anywhere", :to => "foo#bar", :as => :new_admin_password
+ get "/admin_area/home", :to => "admins#index", :as => :admin_root
+ get "/anywhere", :to => "foo#bar", :as => :new_admin_password
authenticate(:admin) do
- match "/private", :to => "home#private", :as => :private
+ get "/private", :to => "home#private", :as => :private
end
authenticate(:admin, lambda { |admin| admin.active? }) do
- match "/private/active", :to => "home#private", :as => :private_active
+ get "/private/active", :to => "home#private", :as => :private_active
end
authenticated :admin do
- match "/dashboard", :to => "home#admin_dashboard"
+ get "/dashboard", :to => "home#admin_dashboard"
end
authenticated :admin, lambda { |admin| admin.active? } do
- match "/dashboard/active", :to => "home#admin_dashboard"
+ get "/dashboard/active", :to => "home#admin_dashboard"
end
authenticated do
- match "/dashboard", :to => "home#user_dashboard"
+ get "/dashboard", :to => "home#user_dashboard"
end
unauthenticated do
- match "/join", :to => "home#join"
+ get "/join", :to => "home#join"
end
# Routes for constraints testing
@@ -92,9 +92,9 @@
devise_for :delete_or_posts, :sign_out_via => [:delete, :post], :class_name => "Admin"
end
- match "/set", :to => "home#set"
- match "/unauthenticated", :to => "home#unauthenticated"
- match "/custom_strategy/new"
+ get "/set", :to => "home#set"
+ get "/unauthenticated", :to => "home#unauthenticated"
+ get "/custom_strategy/new"
root :to => "home#index"
end

0 comments on commit af37800

Please sign in to comment.