Module: Authentasaurus::Ac::Routing::InstanceMethods
- Defined in:
- lib/authentasaurus/ac/routing.rb
Instance Method Summary collapse
-
#authentasaurus_authorizable(*opts) ⇒ Object
TODO: add documentation here.
-
#authentasaurus_invitable(*opts) ⇒ Object
TODO: add documentation here.
- #authentasaurus_invitable_public(*opts) ⇒ Object
-
#authentasaurus_recoverable ⇒ Object
TODO: add documentation here.
-
#authentasaurus_routes(*opts) ⇒ Object
TODO: add documentation here.
-
#authentasaurus_sessions(*opts) ⇒ Object
TODO: add documentation here.
-
#authentasaurus_users(*opts) ⇒ Object
TODO: add documentation here.
-
#authentasaurus_validatable ⇒ Object
TODO: add documentation here.
Instance Method Details
#authentasaurus_authorizable(*opts) ⇒ Object
TODO: add documentation here
52 53 54 55 56 57 58 |
# File 'lib/authentasaurus/ac/routing.rb', line 52 def (*opts) = opts. resources :groups, .dup resources :areas, .dup resources :permissions, .dup end |
#authentasaurus_invitable(*opts) ⇒ Object
TODO: add documentation here
69 70 71 72 73 |
# File 'lib/authentasaurus/ac/routing.rb', line 69 def authentasaurus_invitable(*opts) = opts. resources :user_invitations, .dup.merge({:except => [:show, :edit, :update]}) end |
#authentasaurus_invitable_public(*opts) ⇒ Object
75 76 77 78 79 |
# File 'lib/authentasaurus/ac/routing.rb', line 75 def authentasaurus_invitable_public(*opts) = opts. resources :registrations, :only => [:new, :create], :path_prefix => "/:token", :requirements => {:token => /[0-9a-zA-Z]+/} end |
#authentasaurus_recoverable ⇒ Object
TODO: add documentation here
82 83 84 85 86 87 |
# File 'lib/authentasaurus/ac/routing.rb', line 82 def authentasaurus_recoverable match "/forgot-password" => "recoveries#new", :via => :get, :as => 'forgot_password' match "/forgot-password" => "recoveries#create", :via => :post, :as => 'do_forgot_password' match "/recover-password/:token" => "recoveries#edit", :via => :get, :as => 'recover_password' match "/recover-password/:token" => "recoveries#destroy", :via => :delete, :as => 'do_recover_password' end |
#authentasaurus_routes(*opts) ⇒ Object
TODO: add documentation here
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/authentasaurus/ac/routing.rb', line 10 def authentasaurus_routes(*opts) = opts. # Authenticatable authentasaurus_sessions .dup authentasaurus_users .dup # Recoverable authentasaurus_recoverable # Authorizable if opts.include?(:authorization) .dup end # Validatable if opts.include?(:validation) authentasaurus_validatable end # Invitable if opts.include?(:invitation) authentasaurus_invitable .dup authentasaurus_invitable_public end end |
#authentasaurus_sessions(*opts) ⇒ Object
TODO: add documentation here
37 38 39 40 41 42 |
# File 'lib/authentasaurus/ac/routing.rb', line 37 def authentasaurus_sessions(*opts) get "/sessions/sign-in(.:format)" => "sessions#new", :as => :new_session post "/sessions(.:format)" => "sessions#create", :as => :sessions delete "/sessions/sign-out(.:format)" => "sessions#destroy", :as => :session get "/sessions/no-access(.:format)" => "sessions#no_access", :as => :no_access_sessions end |
#authentasaurus_users(*opts) ⇒ Object
TODO: add documentation here
45 46 47 48 49 |
# File 'lib/authentasaurus/ac/routing.rb', line 45 def authentasaurus_users(*opts) = opts. resources :users, .dup end |
#authentasaurus_validatable ⇒ Object
TODO: add documentation here
61 62 63 64 65 66 |
# File 'lib/authentasaurus/ac/routing.rb', line 61 def authentasaurus_validatable match "/validate" => "validations#validate", :as => 'validate' match "/activate" => "validations#activate", :as => 'activate' match "/resend-validation" => "validations#resend_validation_email", :via => :get, :as => 'recover_password' match "/resend-validation" => "validations#do_resend_validation_email", :via => :post, :as => 'do_recover_password' end |