Class: SearchController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#dashboard, #keyboard_tools, #upload

Instance Method Details

#searchObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/search_controller.rb', line 2

def search
  @posts, @qualifiers = helpers.search_posts

  @signed_out_me = @qualifiers.any? { |q| q[:param] == :user && q[:user_id].nil? }

  @active_filter = helpers.active_filter

  @count = begin
    @posts&.count
  rescue
    @posts = nil
    flash[:danger] = 'Your search syntax is incorrect.'
  end
end