routes.rb 1.29 KB
Newer Older
Sara Kuqi's avatar
fc  
Sara Kuqi committed
1
Rails.application.routes.draw do
ira.maier's avatar
changes    
ira.maier committed
2
3

  # devise, authenticat --> pages are only available for user
pei-chi.huang's avatar
pei-chi.huang committed
4
  devise_for :users
Sara Kuqi's avatar
fc  
Sara Kuqi committed
5

pei-chi.huang's avatar
pei-chi.huang committed
6
7
8
  authenticate :user do
    get 'password_resets/new'
    get 'password_resets/edit'
9

pei-chi.huang's avatar
pei-chi.huang committed
10
    get 'submitformeasurements/new'
11

pei-chi.huang's avatar
pei-chi.huang committed
12
13
14
15
    get 'results/new'
    get 'sessions/new'
    get 'results_field/new'
    get 'results_field/create'
16

pei-chi.huang's avatar
pei-chi.huang committed
17
18
19
    root 'static_pages#home'
    get  '/microposts', to: 'static_pages#microposts'
  end
Sara Kuqi's avatar
fc  
Sara Kuqi committed
20
21
22

  get  '/about',   to: 'static_pages#about'
  get  '/contact', to: 'static_pages#contact'
pei-chi.huang's avatar
pei-chi.huang committed
23
24
25
26
27
28

  devise_scope :user do
    get 'sign_in', to: 'devise/sessions#new'
    get 'signup' => 'devise/registrations#new', type: 'Chemist'
    get 'logout', to: 'webusers/sessions#destroy', as: :logout
  end
Sara Kuqi's avatar
Sara Kuqi committed
29

Sara Kuqi's avatar
fc  
Sara Kuqi committed
30
31
32
  resources :users
  resources :operators, controller: 'users', type: 'Operator'
  resources :chemists, controller: 'users', type: 'Chemist'
33
  resources :samples,          only: [:create, :destroy, :show, :edit, :update]
34
  resources :password_resets,     only: [:new, :create, :edit, :update]
35
  resources :microposts,          only: [:create, :destroy]
Sara Kuqi's avatar
Sara Kuqi committed
36

Sara Kuqi's avatar
Sara Kuqi committed
37
38
39
  resources :samples do
    member do
      get :Measured
Sara Kuqi's avatar
Sara Kuqi committed
40
      get :ReleaseMeasurment
pei-chi.huang's avatar
pei-chi.huang committed
41
      get :Withdraw
Sara Kuqi's avatar
Sara Kuqi committed
42
43
    end
  end
44

Sara Kuqi's avatar
Sara Kuqi committed
45
46
47
48
49
50
  resources :users do
    member do
     get  :change
   end
 end

Sara Kuqi's avatar
Sara Kuqi committed
51
52
53
  resources :results do
    post :sort
  end
54

Sara Kuqi's avatar
fc  
Sara Kuqi committed
55
end