Skip to content

Instantly share code, notes, and snippets.

@justinvt
Created June 9, 2009 17:25
Show Gist options
  • Save justinvt/126669 to your computer and use it in GitHub Desktop.
Save justinvt/126669 to your computer and use it in GitHub Desktop.
def index
if params[:search_agent] && !params[:search_agent][:keywords].empty?
#create a dummy search agent
@search_agent = SearchAgent.new(params[:search_agent])
@search_agent.get #geocode manually
@search = @search_agent.search(:page=>params[:page])
@search.run
@searched_latlon = [@search_agent.placemark.x,@search_agent.placemark.y] unless @search_agent.placemark.nil?
@jobs = @search.results
@save_job_params = {:search_agent => {:keywords => params[:search_agent][:keywords], :location => params[:search_agent][:location]}}
else
flash[:error] = I18n.t(:"search_agent.empty_search")
end
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @jobs }
format.js { render :json => @jobs }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment