diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 27f487d9..9506359b 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -428,7 +428,7 @@ class UsersController < ApplicationController if params[:user].present? - user_temp = User.find_by_sql("select id from users where firstname like '%#{params[:user]}%' or lastname like '%#{params[:user]}%'") + user_temp = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{params[:user]}%' or lastname like '%#{params[:user]}%'") if user_temp.size > 1 activity = Activity.where('user_id in (?)', user_temp).where('user_id in (?)', watcher).order('id desc') diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 9e61c818..681135e8 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,11 +1,21 @@ <% if User.current.id == @user.id%> -<%= show_activity @state%> -<%= form_tag(:controller => 'users', :action => "show") do %> - -<% end %> -<% end %> -<% unless @state == 2%> -<% unless @activity.empty? %> + <%= show_activity @state%> + <%= form_tag(:controller => 'users', :action => "show") do %> +
+ + + + +
+
+
+ <% end %> + <% end %> + <% unless @state == 2%> + <% unless @activity.empty? %>
<% @activity.each do |e| %> <% act = e.act %>