Remove `user#lists` action, view and route
This commit is contained in:
parent
bbaba17634
commit
583a3ba519
|
@ -71,17 +71,6 @@ class UserController < ApplicationController
|
|||
end
|
||||
# endregion
|
||||
|
||||
# region Lists
|
||||
def lists
|
||||
@user = User.where('LOWER(screen_name) = ?', params[:username].downcase).first!
|
||||
@lists = if current_user == @user
|
||||
@user.lists
|
||||
else
|
||||
@user.lists.where(private: false)
|
||||
end.all
|
||||
end
|
||||
# endregion
|
||||
|
||||
def followers
|
||||
@title = 'Followers'
|
||||
@user = User.where('LOWER(screen_name) = ?', params[:username].downcase).includes(:profile).first!
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
%ul
|
||||
- @lists.each do |list|
|
||||
%li
|
||||
- if list.private?
|
||||
%i.fa.fa-lock
|
||||
= list.display_name
|
||||
|
||||
- provide(:title, user_title(@user, 'lists'))
|
||||
- parent_layout 'user/profile'
|
|
@ -143,7 +143,6 @@ Rails.application.routes.draw do
|
|||
match '/:username/followers(/p/:page)', to: 'user#followers', via: 'get', as: :show_user_followers, defaults: {page: 1}
|
||||
match '/:username/followings(/p/:page)', to: 'user#followings', via: 'get', as: :show_user_followings, defaults: {page: 1}
|
||||
match '/:username/friends(/p/:page)', to: redirect('/%{username}/followings/p/%{page}'), via: 'get', defaults: {page: 1}
|
||||
match '/:username/lists(/p/:page)', to: 'user#lists', via: 'get', as: :show_user_lists, defaults: {page: 1}
|
||||
match '/:username/questions(/p/:page)', to: 'user#questions', via: 'get', as: :show_user_questions, defaults: {page: 1}
|
||||
|
||||
match '/feedback/consent', to: 'feedback#consent', via: 'get', as: 'feedback_consent'
|
||||
|
|
Loading…
Reference in New Issue