Class: Clearance::Routes

Inherits:
Object
  • Object
show all
Defined in:
lib/clearance/routes.rb

Class Method Summary collapse

Class Method Details

.draw(map) ⇒ Object

In your application’s config/routes.rb, draw Clearance’s routes:

If you need to override a Clearance route, invoke your app route earlier in the file so Rails’ router short-circuits when it finds your route:

Examples:

map.resources :posts
Clearance::Routes.draw(map)
map.resources :users, :only => [:new, :create]
Clearance::Routes.draw(map)


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/clearance/routes.rb', line 17

def self.draw(map)
  map.resources :passwords,
    :controller => 'clearance/passwords',
    :only       => [:new, :create]

  map.resource  :session,
    :controller => 'clearance/sessions',
    :only       => [:new, :create, :destroy]

  map.resources :users, :controller => 'clearance/users' do |users|
    users.resource :password,
      :controller => 'clearance/passwords',
      :only       => [:create, :edit, :update]

    users.resource :confirmation,
      :controller => 'clearance/confirmations',
      :only       => [:new, :create]
  end

  map.  'sign_up',
    :controller => 'clearance/users',
    :action     => 'new'
  map.connect 'channel.html',
    :controller => 'clearance/sessions',
    :action     => 'channel'
  map.  'sign_in',
    :controller => 'clearance/sessions',
    :action     => 'new'
  map.sign_out 'sign_out',
    :controller => 'clearance/sessions',
    :action     => 'destroy',
    :method     => :delete
  map.facebook  'facebook',
      :controller => 'clearance/facebook',
      :action     => 'index'
  map.fbclosed  'fbclosed',
      :controller => 'clearance/facebook',
      :action     => 'closed'          
end