diff --git a/app/controllers/stores_controller.rb b/app/controllers/stores_controller.rb index 84a9c95d6..ad622096d 100644 --- a/app/controllers/stores_controller.rb +++ b/app/controllers/stores_controller.rb @@ -6,7 +6,7 @@ class StoresController < ApplicationController def search name = params[:name] ||= '' - redirect_to stores_path, :notice => l(:field_course_un) if name.blank? + (redirect_to stores_path, :notice => l(:label_sumbit_empty);return) if name.blank? # 按文件名搜索 resultSet = Attachment.where("attachments.container_type IS NOT NULL AND filename LIKE :like ", like: "%#{name}%"). reorder("created_on DESC") diff --git a/app/views/stores/_search_bar.html.erb b/app/views/stores/_search_bar.html.erb index 3221bd5b2..32caa11a8 100644 --- a/app/views/stores/_search_bar.html.erb +++ b/app/views/stores/_search_bar.html.erb @@ -1,6 +1,6 @@
<%= form_tag( search_stores_path, method: 'post') do %> - <%= text_field_tag 'name', params[:name], size:"100", placeholder:'请输入要搜索的关键字', :class => 'blueinputbar', :required => true %> + <%= text_field_tag 'name', params[:name], size:"100", placeholder:'请输入要搜索的关键字', name: "name", :class => 'blueinputbar'%> <%= submit_tag l(:label_search), :class => "enterprise"%> <% end %>
\ No newline at end of file diff --git a/app/views/stores/index.html.erb b/app/views/stores/index.html.erb index a253ea330..4df1b8239 100644 --- a/app/views/stores/index.html.erb +++ b/app/views/stores/index.html.erb @@ -32,6 +32,23 @@ <% reset_cycle; end %>