Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #some_object_controller.rb
- class SomeObjectController < ApplicationController
- def search
- @search_results = SomeClass.find(params[:search_term])
- end
- end
- # search.html.haml
- - if @search_results.count > 0
- - @search_results.each do |result|
- #...
- - else
- %p Sorry, you have no results!
Add Comment
Please, Sign In to add comment