Guest User

Untitled

a guest
Feb 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. require_dependency "search_helper"
  2.  
  3. class Admin::SearchController < Admin::AskenController
  4. include SearchHelper
  5.  
  6. search_mode :public => false
  7.  
  8. model([:document, :tag, :archive_file, :image_file, :profile_image, :meta_file] + AskenEngine.content_model_names)
  9.  
  10. def self.extra_search_models
  11. [ Group, Comment, User ] # BaseContent is used by default
  12. end
  13.  
  14. def index
  15.  
  16. end
  17.  
  18. # method to be compatible with the old SimplSearch-api this should be redone
  19. def search
  20. view_results( self.extra_search_models )
  21. render :action => 'results'
  22. end
  23.  
  24. def results
  25. view_results( self.extra_search_models)
  26. end
  27.  
  28.  
  29. #-----------------------------------------------------------------------
  30. # search through the index, get the ActiveRecord's that match and
  31. # return those to the caller
  32. #-----------------------------------------------------------------------
  33. def live
  34.  
  35. @base_content = BaseContent.find_by_id(params[:base_content_id])
  36. @base_content ||=BaseContent.new
  37.  
  38. # call ferret
  39. view_results()
  40.  
  41. render :partial => 'editing_results', :locals => { :results => @results, :base_content => @base_content, :show_tools => true }
Add Comment
Please, Sign In to add comment