Skip to content

Instantly share code, notes, and snippets.

@knwang
Created October 8, 2011 20:13
Show Gist options
  • Save knwang/1272812 to your computer and use it in GitHub Desktop.
Save knwang/1272812 to your computer and use it in GitHub Desktop.
Proofing_oven: candidate controller with search
class CandidatesController < ApplicationController
expose(:candidates) { Candidate.order(:first_name) }
expose(:search_term) { params[:search] }
expose(:search_results) { Candidate.search(search_term) if search_term }
def search
render :index
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment