Skip to content
Extraits de code Groupes Projets
Valider c62a9a2e rédigé par Gonzalo Rodriguez's avatar Gonzalo Rodriguez
Parcourir les fichiers

Little refactor on PeopleController#index

parent fbb17ec1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -19,12 +19,15 @@ class PeopleController < ApplicationController ...@@ -19,12 +19,15 @@ 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
return tag_name = params[:q].gsub(/[#\.]/, '')
elsif (params[:q][0] == 35 || params[:q][0] == '#') && params[:q].length == 1 redirect_to tag_path(:name => tag_name, :q => params[:q])
flash[:error] = I18n.t('tags.show.none', :name => params[:q]) return
redirect_to :back else
flash[:error] = I18n.t('tags.show.none', :name => params[:q])
redirect_to :back
end
end end
limit = params[:limit] ? params[:limit].to_i : 15 limit = params[:limit] ? params[:limit].to_i : 15
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter