Skip to content

Commit

Permalink
Minor fix to previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Undo1 committed Jan 12, 2016
1 parent 947c614 commit 3274ca8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class SearchController < ApplicationController
def search_results
username = params[:username].presence || '*'
title = params[:title].presence || '*'
body = params[:body].presence || '*'
username = params[:username] || ""
title = params[:title] || ""
body = params[:body] || ""
@results = Post.where("username LIKE :username AND title LIKE :title AND body LIKE :body", username: "%" + username + "%", title: "%" + title + "%", body: "%" + body + "%").paginate(:page => params[:page], :per_page => 100).order("created_at DESC")

if params[:site].present?
Expand Down

0 comments on commit 3274ca8

Please sign in to comment.