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