Soler basic search
This commit is contained in:
parent
6ed89ea9af
commit
481f04c07b
|
@ -19,7 +19,11 @@ class Panel::Dictionary::FrontEnd::DictionaryVocabsController < OrbitWidgetContr
|
||||||
# end
|
# end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@vocabs = DictionaryVocab.all
|
if params[:search_query].empty?
|
||||||
|
@vocabs = DictionaryVocab.all
|
||||||
|
else
|
||||||
|
@vocabs = DictionaryVocab.search(params[:search_query])
|
||||||
|
end
|
||||||
# @item = Page.find(params[:page_id])
|
# @item = Page.find(params[:page_id])
|
||||||
# @title = @item.title
|
# @title = @item.title
|
||||||
# if !@item.frontend_data_count.blank?
|
# if !@item.frontend_data_count.blank?
|
||||||
|
|
|
@ -27,6 +27,17 @@ class DictionaryVocab
|
||||||
|
|
||||||
belongs_to :dictionary_vocab_category
|
belongs_to :dictionary_vocab_category
|
||||||
|
|
||||||
|
def self.search(search)
|
||||||
|
if search
|
||||||
|
@search = DictionaryVocab.solr_search do
|
||||||
|
fulltext(search)
|
||||||
|
with(:frontend_search, true)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
scoped
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# has_many :archive_file_multiples, :autosave => true, :dependent => :destroy
|
# has_many :archive_file_multiples, :autosave => true, :dependent => :destroy
|
||||||
|
|
||||||
# accepts_nested_attributes_for :archive_file_multiples, :allow_destroy => true
|
# accepts_nested_attributes_for :archive_file_multiples, :allow_destroy => true
|
||||||
|
|
|
@ -12,11 +12,11 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
|
|
||||||
namespace :front_end do
|
namespace :front_end do
|
||||||
|
get "dictionary_vocabs", to: "dictionary_vocabs#index"
|
||||||
resources :dictionary_vocabs
|
resources :dictionary_vocabs
|
||||||
end
|
end
|
||||||
|
|
||||||
namespace :widget do
|
namespace :widget do
|
||||||
# match "index" => "archive_files#index"
|
|
||||||
get "dictionary_search_block", to: "dictionary_vocabs#dictionary_search_block"
|
get "dictionary_search_block", to: "dictionary_vocabs#dictionary_search_block"
|
||||||
get "dictionary_vocabs", to: "dictionary_vocabs#index"
|
get "dictionary_vocabs", to: "dictionary_vocabs#index"
|
||||||
resources :dictionary_vocabs
|
resources :dictionary_vocabs
|
||||||
|
|
|
@ -29,7 +29,7 @@ module Dictionary
|
||||||
# link_field :archive_file_category_with_title,{:method => 'panel_archive_front_end_archive_files_path',:args=>{:category_id => [:archive_file_category,:id]}}
|
# link_field :archive_file_category_with_title,{:method => 'panel_archive_front_end_archive_files_path',:args=>{:category_id => [:archive_file_category,:id]}}
|
||||||
# end
|
# end
|
||||||
|
|
||||||
# categories_query 'ArchiveFileCategory.all'
|
categories_query 'DictionaryVocabCategory.all'
|
||||||
# tags_query 'ArchiveTag.all'
|
# tags_query 'ArchiveTag.all'
|
||||||
|
|
||||||
# customize_widget "index" do
|
# customize_widget "index" do
|
||||||
|
|
Loading…
Reference in New Issue