Class: SearchController

Inherits:
ApplicationController show all
Defined in:
app/controllers/search_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject


2
3
4
5
6
7
8
# File 'app/controllers/search_controller.rb', line 2

def index
  @posts = if params[:q].present?
             find_posts(params[:q])
           else
             Post.none
           end
end