2016-01-12 18:43:00 -06:00
|
|
|
Rails.application.routes.draw do
|
|
|
|
|
2016-01-18 19:41:26 -06:00
|
|
|
resources :recipes do
|
|
|
|
member do
|
|
|
|
get 'scale/:factor', action: :scale, as: :scale
|
|
|
|
end
|
|
|
|
end
|
2016-01-14 18:56:45 -06:00
|
|
|
|
|
|
|
resources :ingredients, except: [:show] do
|
2016-01-14 15:22:15 -06:00
|
|
|
collection do
|
2016-01-28 14:19:51 -06:00
|
|
|
get :usda_food_search
|
|
|
|
|
2016-01-14 15:22:15 -06:00
|
|
|
constraints format: 'json' do
|
|
|
|
get :search
|
|
|
|
get :prefetch
|
2016-01-18 12:58:54 -06:00
|
|
|
get :convert
|
2016-01-14 15:22:15 -06:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2016-01-12 18:43:00 -06:00
|
|
|
|
2016-01-29 18:45:20 -06:00
|
|
|
match '/ingredients(/:id)/select_ndbn' => 'ingredients#select_ndbn', via: [:post, :patch, :put]
|
|
|
|
|
2016-01-19 16:50:39 -06:00
|
|
|
resource :user, only: [:new, :create, :edit, :update]
|
|
|
|
|
|
|
|
get '/login' => 'users#login', as: :login
|
|
|
|
post '/login' => 'users#verify_login'
|
|
|
|
get '/logout' => 'users#logout', as: :logout
|
|
|
|
|
2016-01-30 21:20:15 -06:00
|
|
|
get '/about' => 'home#about', as: :about
|
|
|
|
|
2016-01-12 18:43:00 -06:00
|
|
|
root 'recipes#index'
|
|
|
|
|
|
|
|
|
|
|
|
end
|