Created
October 8, 2011 20:13
-
-
Save knwang/1272812 to your computer and use it in GitHub Desktop.
Proofing_oven: candidate controller with search
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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