This commit is contained in:
Toks
2013-05-13 15:25:52 -04:00
parent ea992e28cd
commit eeadd6b211

View File

@@ -15,10 +15,15 @@ class UsersController < ApplicationController
end
def index
@users = User.search(params[:search]).order("users.id desc").paginate(params[:page], :search_count => params[:search])
respond_with(@users) do |format|
format.xml do
render :xml => @users.to_xml(:root => "users")
if params[:name].present?
@user = User.find_by_name(params[:name])
redirect_to user_path(@user)
else
@users = User.search(params[:search]).order("users.id desc").paginate(params[:page], :search_count => params[:search])
respond_with(@users) do |format|
format.xml do
render :xml => @users.to_xml(:root => "users")
end
end
end
end