Class: SearchController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- SearchController
- Defined in:
- app/controllers/search_controller.rb
Overview
Searching for posts
Instance Method Summary collapse
-
#index ⇒ Object
get /search?q=.
Instance Method Details
#index ⇒ Object
get /search?q=
6 7 8 9 |
# File 'app/controllers/search_controller.rb', line 6 def index q = param_from_request(:q).to_s[0..100] @collection = q.blank? ? [] : Post.pg_search(q).page_for_visitors(current_page) end |