Module: Helpers::Routing::InstanceMethods

Defined in:
lib/helpers/routing.rb

Instance Method Summary collapse

Instance Method Details

#authentasaurus_authorizable(*opts) ⇒ Object

TODO: add documentation here



50
51
52
53
54
55
56
# File 'lib/helpers/routing.rb', line 50

def authentasaurus_authorizable(*opts)
  options = opts.extract_options!
  
  resources :groups, options.dup
  resources :areas, options.dup
  resources :permissions, options.dup
end

#authentasaurus_invitable(*opts) ⇒ Object

TODO: add documentation here



68
69
70
71
72
# File 'lib/helpers/routing.rb', line 68

def authentasaurus_invitable(*opts)
  options = opts.extract_options!
  
  resources :user_invitations, options.dup.merge({:except => [:show, :edit, :update]})
end

#authentasaurus_invitable_public(*opts) ⇒ Object



74
75
76
77
78
# File 'lib/helpers/routing.rb', line 74

def authentasaurus_invitable_public(*opts)
  options = opts.extract_options!
  
  resources :registrations, :only => [:new, :create], :path_prefix => "/:token", :requirements => {:token => /[0-9a-zA-Z]+/}
end

#authentasaurus_recoverable(*opts) ⇒ Object

TODO: add documentation here



81
82
83
84
85
86
87
88
# File 'lib/helpers/routing.rb', line 81

def authentasaurus_recoverable(*opts)
 	options = opts.extract_options!
 	
	forgot_password			"/forgot-password", 					options.dup.merge({ :controller => :recoveries, :action => :new,			:conditions => { :method => :get } })
	do_forgot_password	"/forgot-password", 					options.dup.merge({ :controller => :recoveries, :action => :create,		:conditions => { :method => :post } })
	recover_password		"/recover-password/:token", 	options.dup.merge({ :controller => :recoveries, :action => :edit,			:conditions => { :method => :get } })
	do_recover_password	"/recover-password/:token", 	options.dup.merge({ :controller => :recoveries, :action => :destroy,	:conditions => { :method => :delete } })
end

#authentasaurus_routes(*opts) ⇒ Object

TODO: add documentation here



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/helpers/routing.rb', line 9

def authentasaurus_routes(*opts)
  options = opts.extract_options!
  
  # Authenticatable
  authentasaurus_sessions options.dup
  authentasaurus_users options.dup
  # Recoverable
	authentasaurus_recoverable options.dup
  
  # Authorizable
  if opts.include?(:authorizable)
    authentasaurus_authorizable options.dup
  end
  
  # Validatable
  if opts.include?(:validatable)
    authentasaurus_validatable options.dup
  end
  
  # Invitable
  if opts.include?(:invitable)
    authentasaurus_invitable options.dup
    authentasaurus_invitable_public
  end
end

#authentasaurus_sessions(*opts) ⇒ Object

TODO: add documentation here



36
37
38
39
40
# File 'lib/helpers/routing.rb', line 36

def authentasaurus_sessions(*opts)
  options = opts.extract_options!
  
  resources :sessions, options.dup.merge({:except => [:index, :show, :edit, :update], :path_names => {:new => 'sign-in'}, :collection => {:no_access => :get}})
end

#authentasaurus_users(*opts) ⇒ Object

TODO: add documentation here



43
44
45
46
47
# File 'lib/helpers/routing.rb', line 43

def authentasaurus_users(*opts)
  options = opts.extract_options!
  
  resources :users, options.dup
end

#authentasaurus_validatable(*opts) ⇒ Object

TODO: add documentation here



59
60
61
62
63
64
65
# File 'lib/helpers/routing.rb', line 59

def authentasaurus_validatable(*opts)
  options = opts.extract_options!
  
  validate "/validate", options.dup.merge({:controller => :validations, :action => :activate})
  resend_validation_email "/resend-validation", options.dup.merge({:controller => :validations, :action => :resend_validation_email, :conditions => {:method => :get}})
  do_resend_validation_email "/resend-validation", options.dup.merge({:controller => :validations, :action => :do_resend_validation_email, :conditions => {:method => :post}})
end