Module: Agilib::Routing::MapperExtensions

Defined in:
lib/agilib/routing.rb

Instance Method Summary collapse

Instance Method Details

#agilibObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/agilib/routing.rb', line 5

def agilib
  
  if Agilib.rails4? && Rails.env.development?
    root :to => "agilib/welcome#index", :as => :agilib_root
  end

  if Agilib.use_modules[:token_authenticatable].present?
    agilib_token_authenticatable
  end

  if Agilib.use_modules[:push_notification].present?
    agilib_push_notification
  end

end

#agilib_push_notificationObject



30
31
32
33
# File 'lib/agilib/routing.rb', line 30

def agilib_push_notification
  path = Agilib::PushNotification.device_route
  resources :devices, :path => path, :controller => "agilib/devices"
end

#agilib_token_authenticatableObject



21
22
23
24
25
26
27
28
# File 'lib/agilib/routing.rb', line 21

def agilib_token_authenticatable
    route = Agilib::TokenAuthenticatable.route
    devise_scope :user do 
      post    "#{route}"        => "agilib/tokens#create"
      delete  "#{route}"        => "agilib/tokens#destroy"
      get     "#{route}/check"  => "agilib/tokens#check"
    end
end