Permalink
Browse files

merged older commit

  • Loading branch information...
2 parents d56a1c2 + b5b92d9 commit f7170a1c0b45e1e0e897e16b05033e6ae25fbe7f @mshwery mshwery committed Oct 19, 2011
Showing with 3 additions and 14 deletions.
  1. +1 −5 app/controllers/users_controller.rb
  2. +0 −7 app/models/user.rb
  3. +2 −2 app/views/users/_form.html.erb
@@ -5,14 +5,10 @@ class UsersController < ApplicationController
def index
if params[:category]
@users = User.find_by_category(params[:category]).paginate(:per_page => 30, :page => params[:page])
- elsif params[:search]
- @search = User.search do
- fulltext params[:search]
- end
- @users = @search.results.paginate(:per_page => 30, :page => params[:page])
else
@users = User.includes(:missions => :category).order('created_at DESC').paginate(:per_page => 30, :page => params[:page])
end
+
if request.xhr?
render :partial => @users
else
View
@@ -41,13 +41,6 @@ class User < ActiveRecord::Base
accepts_nested_attributes_for :missions, :reject_if => proc {|attributes| attributes['statement'].blank? }
- searchable do
- text :name
- text :missions do
- missions.map { |mission| mission.statement }
- end
- end
-
def self.find_by_category(category_id)
includes(:missions => :category).where(["categories.id = ?", category_id])
end
@@ -28,8 +28,8 @@
</div>
<div class="avatar left">
- <% if @user.avatar.url and @user.created_at %>
- <%= f.label :avatar, 'Upload Photo', :class => 'true', :style => 'background-image: url('+@user.avatar.url(:medium)+');' %>
+ <% if @user.avatar.url and @user.created_at %>
+ <%= f.label :avatar, 'Upload Photo', :class => 'true', :style => 'background-image: url('+@user.avatar(:medium)+');' %>
<% else %>
<%= f.label :avatar, 'Upload Photo', :class => 'false' %>
<% end %>

0 comments on commit f7170a1

Please sign in to comment.