Little refactor on PeopleController#index
This commit is contained in:
parent
fbb17ec1a5
commit
c62a9a2e63
1 changed files with 9 additions and 6 deletions
|
|
@ -19,12 +19,15 @@ class PeopleController < ApplicationController
|
|||
@aspect = :search
|
||||
params[:q] ||= params[:term] || ''
|
||||
|
||||
if (params[:q][0] == 35 || params[:q][0] == '#') && params[:q].length > 1
|
||||
redirect_to tag_path(:name => params[:q].gsub(/[#\.]/, ''), :q => params[:q])
|
||||
return
|
||||
elsif (params[:q][0] == 35 || params[:q][0] == '#') && params[:q].length == 1
|
||||
flash[:error] = I18n.t('tags.show.none', :name => params[:q])
|
||||
redirect_to :back
|
||||
if params[:q][0] == 35 || params[:q][0] == '#'
|
||||
if params[:q].length > 1
|
||||
tag_name = params[:q].gsub(/[#\.]/, '')
|
||||
redirect_to tag_path(:name => tag_name, :q => params[:q])
|
||||
return
|
||||
else
|
||||
flash[:error] = I18n.t('tags.show.none', :name => params[:q])
|
||||
redirect_to :back
|
||||
end
|
||||
end
|
||||
|
||||
limit = params[:limit] ? params[:limit].to_i : 15
|
||||
|
|
|
|||
Loading…
Reference in a new issue