Class: BlueLightSpecial::Routes

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

Class Method Summary collapse

Class Method Details

.draw(map) ⇒ Object

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

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

Examples:

map.resources :posts
BlueLightSpecial::Routes.draw(map)
map.resources :users, :only => [:new, :create]
BlueLightSpecial::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
56
57
58
59
60
61
62
63
64
# File 'lib/blue_light_special/routes.rb', line 17

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

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

  map.resources :users, :controller => 'blue_light_special/users' do |users|
    users.resource :password,
      :controller => 'blue_light_special/passwords',
      :only       => [:create, :edit, :update]
      
    users.resource :confirmation,
      :controller => 'blue_light_special/confirmations',
      :only       => [:new, :create]
  end
  
  map.resource :impersonation,
    :controller => 'blue_light_special/impersonations',
    :only       => [:create, :destroy]
  map.resources :impersonations,
    :controller => 'blue_light_special/impersonations',
    :only       => :index
    
  map.    'sign_up',
    :controller   => 'blue_light_special/users',
    :action       => 'new'
  map.    'sign_in',
    :controller   => 'blue_light_special/sessions',
    :action       => 'new'
  map.fb_connect 'fb_connect',
    :controller   => 'blue_light_special/sessions',
    :action       => 'create'
  map.fb_disconnect 'fb_disconnect',
    :controller   => 'blue_light_special/users',
    :action       => 'facebook_remove'
  map.sign_out   'sign_out',
    :controller   => 'blue_light_special/sessions',
    :action       => 'destroy',
    :method       => :delete
  map.admin      'admin', 
    :controller   => '/admin/admin',
    :action       => :index

  map.root :controller => "sessions", :action => 'index'
end