From a95138042e2ab2eba951a63000e755d0756b963d Mon Sep 17 00:00:00 2001 From: Canan Date: Sat, 16 May 2020 15:01:23 +0300 Subject: [PATCH] Create teams controller and adjust navbar --- app/assets/stylesheets/teams.scss | 3 +++ app/controllers/teams_controller.rb | 5 +++++ app/helpers/teams_helper.rb | 2 ++ app/javascript/packs/application.js | 10 +++++----- app/views/layouts/_navigation.html.erb | 23 ++++++++++++----------- app/views/layouts/application.html.erb | 8 +++++--- app/views/teams/index.html.erb | 5 +++++ config/routes.rb | 1 + test/controllers/teams_controller_test.rb | 7 +++++++ 9 files changed, 45 insertions(+), 19 deletions(-) create mode 100644 app/assets/stylesheets/teams.scss create mode 100644 app/controllers/teams_controller.rb create mode 100644 app/helpers/teams_helper.rb create mode 100644 app/views/teams/index.html.erb create mode 100644 test/controllers/teams_controller_test.rb diff --git a/app/assets/stylesheets/teams.scss b/app/assets/stylesheets/teams.scss new file mode 100644 index 0000000..8ed4367 --- /dev/null +++ b/app/assets/stylesheets/teams.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the teams controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: https://sass-lang.com/ diff --git a/app/controllers/teams_controller.rb b/app/controllers/teams_controller.rb new file mode 100644 index 0000000..6f7e3ae --- /dev/null +++ b/app/controllers/teams_controller.rb @@ -0,0 +1,5 @@ +class TeamsController < ApplicationController + def index + @teams = Team.all + end +end diff --git a/app/helpers/teams_helper.rb b/app/helpers/teams_helper.rb new file mode 100644 index 0000000..5fb41eb --- /dev/null +++ b/app/helpers/teams_helper.rb @@ -0,0 +1,2 @@ +module TeamsHelper +end diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index ab518e4..d75f8ee 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -16,10 +16,10 @@ require('jquery') // // const images = require.context('../images', true) // const imagePath = (name) => images(name, true) +// $( document ).ready(function() { +// $('.ui.dropdown').dropdown(); +// }); -$(document).on('turbolinks:load', function() { - $('.item').click(function(e) { - $('.active').removeClass('active'); - $(this).addClass('active'); -}); +$(document).on('turbolinks:load', function () { + // $('.ui.dropdown').dropdown(); use this later on @canan }) \ No newline at end of file diff --git a/app/views/layouts/_navigation.html.erb b/app/views/layouts/_navigation.html.erb index a6de208..8a2a633 100644 --- a/app/views/layouts/_navigation.html.erb +++ b/app/views/layouts/_navigation.html.erb @@ -1,13 +1,14 @@ -
-