Frontend for Search working

This commit is contained in:
saurabhbhatia 2013-12-23 10:07:58 +08:00
parent f51e9f3a3a
commit 728ba622b7
3 changed files with 0 additions and 15 deletions

View File

@ -9,19 +9,6 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
end
def search_result
debug
if params[:search_query] == ""
@bulletins = get_bulletins_for_index
else
@search = Bulletin.tire.search "#{params[:search_query]}"
search_result = @search.collect{|result| result.id}
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
end
end
def search
if params[:search_query] == ""
@bulletins = get_bulletins_for_index
else

View File

@ -1,4 +1,3 @@
<p>Test</p>
<% # encoding: utf-8 %>
<%= flash_messages %>
<h1 class="h1"><%= @page.title rescue nil %></h1>

View File

@ -28,7 +28,6 @@ Rails.application.routes.draw do
namespace :front_end do
match "index_by_unit" => "bulletins#index_bulletins_by_unit",:as => :index_bulletins_by_unit
match "search_result" => "bulletins#search_result"
match "search" => "bulletins#search"
resources :bulletins # do
# match "preview" => "bulletins#preview_content",:as => :get_preview_content