Add search block

This commit is contained in:
Bernie Chiu 2013-08-25 14:40:34 +08:00 committed by chris
parent ca6b70660d
commit 000fcdd48f
3 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,15 @@
class Panel::Dictionary::Widget::DictionaryVocabsController < OrbitWidgetController
include AdminHelper
def initialize
super
@app_title = 'dictionary_vocabs'
end
def get_categorys
@dictionary_vocab_categorys = DictionaryVocabCategory.excludes('disable' => true)
end
def dictionary_search_block
end
end

View File

@ -0,0 +1,7 @@
<%= form_tag panel_dictionary_front_end_dictionary_vocabs_path, method: :get do %>
<%= hidden_field_tag :category_id, params[:category_id] %>
<p>
<%= text_field_tag :search_query, params[:search_query],{ value: (params[:search_query].blank? ? '' : params[:search_query]), placeholder: t("dictionary.widget.search") }%>
<%= submit_tag "Search", name: nil %>
</p>
<% end %>

View File

@ -12,7 +12,14 @@ Rails.application.routes.draw do
end
namespace :front_end do
match "dictionary_vocabs" => "dictionary_vocabs#index"
get "dictionary_vocabs" => "dictionary_vocabs#index"
# resources :archive_files
end
namespace :widget do
# match "index" => "archive_files#index"
get "dictionary_search_block", to: "dictionary_vocabs#dictionary_search_block"
get "dictionary_vocabs", to: "dictionary_vocabs#index"
resources :dictionary_vocabs
end
# namespace :widget do