search function

This commit is contained in:
Andreas Stephanides
2014-02-08 16:39:56 +01:00
parent 05dbffd4f6
commit d3ac7504dc
11 changed files with 122 additions and 38 deletions

View File

@@ -11,4 +11,19 @@ class HomeController < ApplicationController
def linksnotimplemented
render 'links_notimplemented'
end
def search
unless params['query'].nil? || params['query'].empty?
@neuigkeiten=Neuigkeit.search(params['query'])
@fetprofiles = Fetprofile.search(params['query'])
@themen=Thema.search(params['query'])
else
@neuigkeiten=[]
@fetprofiles=[]
@themen=[]
end
respond_to do |format|
format.html
format.js
end
end
end