From ae6a202e59ce19f11383bc98c5acd02559ab8d14 Mon Sep 17 00:00:00 2001 From: Pfingstfrosch Date: Tue, 12 May 2020 19:16:18 +0200 Subject: [PATCH] refactored routes file: now using namespaces to make the file more readable and better structured --- config/routes.rb | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 6b17ded..59a531b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,24 +2,36 @@ Rails.application.routes.draw do devise_for :users, path_names: {sign_in: 'log_in', sign_out: 'log out'} - get 'login/index' + namespace :login do + get 'index' + end - get 'tiss_crawler/search' + namespace :tiss_crawler do + get 'search' + end - get 'people_crawler/show_basic' - get 'people_crawler/show_detail' - post 'people_crawler/show_detail' - get 'people_crawler/add_to_fav' - post 'people_crawler/add_to_fav' + namespace :people_crawler do + get 'show_basic' + get 'show_detail' + post 'show_detail' + get 'add_to_fav' + post 'add_to_fav' + end - get 'courses_crawler/show_basic' - get 'courses_crawler/show_detail' - post 'courses_crawler/show_detail' - get 'courses_crawler/add_to_fav' - post 'courses_crawler/add_to_fav' + namespace :courses_crawler do + get 'show_basic' + get 'show_detail' + post 'show_detail' + get 'add_to_fav' + post 'add_to_fav' + end namespace :favorites do - get 'favorite_person/index' + get 'index' + get 'people' + get 'courses' + get 'theses' + get 'projects' end # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html