case insensitive user names in URLs? why the heck knot!
This commit is contained in:
parent
82444b8787
commit
72f0f577a1
|
@ -1,6 +1,6 @@
|
||||||
class UserController < ApplicationController
|
class UserController < ApplicationController
|
||||||
def show
|
def show
|
||||||
@user = User.find_by_screen_name!(params[:username])
|
@user = User.where('LOWER(screen_name) = ?', params[:username].downcase).first
|
||||||
@answers = @user.answers.reverse_order.paginate(page: params[:page])
|
@answers = @user.answers.reverse_order.paginate(page: params[:page])
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
|
@ -23,7 +23,7 @@ class UserController < ApplicationController
|
||||||
|
|
||||||
def followers
|
def followers
|
||||||
@title = 'Followers'
|
@title = 'Followers'
|
||||||
@user = User.find_by_screen_name!(params[:username])
|
@user = User.where('LOWER(screen_name) = ?', params[:username].downcase).first
|
||||||
@users = @user.followers.reverse_order.paginate(page: params[:page])
|
@users = @user.followers.reverse_order.paginate(page: params[:page])
|
||||||
@type = :friend
|
@type = :friend
|
||||||
render 'show_follow'
|
render 'show_follow'
|
||||||
|
@ -31,7 +31,7 @@ class UserController < ApplicationController
|
||||||
|
|
||||||
def friends
|
def friends
|
||||||
@title = 'Following'
|
@title = 'Following'
|
||||||
@user = User.find_by_screen_name!(params[:username])
|
@user = User.where('LOWER(screen_name) = ?', params[:username].downcase).first
|
||||||
@users = @user.friends.reverse_order.paginate(page: params[:page])
|
@users = @user.friends.reverse_order.paginate(page: params[:page])
|
||||||
@type = :friend
|
@type = :friend
|
||||||
render 'show_follow'
|
render 'show_follow'
|
||||||
|
|
Loading…
Reference in New Issue