class CommunityController < ApplicationController helper :profile def index @title = "Community" @letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("") if params[:id] @initial = params[:id] @pages, specs = paginate(:specs, :conditions => ["last_name LIKE ?", @initial+"%"], :order => "last_name, first_name") @users = specs.collect { |spec| spec.user } end end def browse end def search @title = "Search RailsSpace" if params[:q] query = params[:q] # First find the user hits... @users = User.find_by_contents(query, :limit => :all) # ...then the subhits. specs = Spec.find_by_contents(query, :limit => :all) faqs = Faq.find_by_contents(query, :limit => :all) end end end