From 83d4368af7d398eff97847e2d07f283a5019d64f Mon Sep 17 00:00:00 2001 From: Pfingstfrosch Date: Sat, 16 May 2020 13:30:00 +0200 Subject: [PATCH] first attempt of making favorite people view sortable --- app/assets/stylesheets/favorites.scss | 4 ++ app/controllers/favorites_controller.rb | 3 +- app/views/favorites/people.html.erb | 65 ++++++++++++++++++------- 3 files changed, 54 insertions(+), 18 deletions(-) diff --git a/app/assets/stylesheets/favorites.scss b/app/assets/stylesheets/favorites.scss index 2baf7cb..c3f5840 100644 --- a/app/assets/stylesheets/favorites.scss +++ b/app/assets/stylesheets/favorites.scss @@ -22,4 +22,8 @@ a:hover, a:active { background-color: #009688; } +} + +.thumb { + width: 3em; } \ No newline at end of file diff --git a/app/controllers/favorites_controller.rb b/app/controllers/favorites_controller.rb index f53bef6..a6de6a3 100644 --- a/app/controllers/favorites_controller.rb +++ b/app/controllers/favorites_controller.rb @@ -1,7 +1,8 @@ class FavoritesController < ApplicationController def people - @favoritePeople = FavoritePerson.where('user_id': current_user.id) + @favorite_people = FavoritePerson.where('user_id': current_user.id) + .order(params[:sort]) @host = 'https://tiss.tuwien.ac.at' end diff --git a/app/views/favorites/people.html.erb b/app/views/favorites/people.html.erb index eeadd54..edfa364 100644 --- a/app/views/favorites/people.html.erb +++ b/app/views/favorites/people.html.erb @@ -1,25 +1,56 @@ -<%= render(:partial => "nav")%> +<%= render(:partial => "nav") %>

Favorite People

-