add backend search feature

This commit is contained in:
邱博亞 2023-02-27 10:34:02 +08:00
parent a0e5539620
commit 5d14333c33
2 changed files with 9 additions and 1 deletions

View File

@ -47,7 +47,14 @@ class Admin::JournalPapersController < OrbitMemberController
end end
end end
def index def index
@writing_journals = JournalPaper.sort_year_date.page(params[:page]).per(10) @writing_journals = JournalPaper.sort_year_date
if params[:keywords]
@writing_journals = search_data(@writing_journals,[:slug_title])
end
@writing_journals = @writing_journals.page(params[:page]).per(10)
if request.xhr?
render :partial => "writing_journal"
end
end end
def new def new

View File

@ -4,6 +4,7 @@ function MergeUrl(){
location.href = '<%= merge_admin_journal_papers_path %>' location.href = '<%= merge_admin_journal_papers_path %>'
} }
</script> </script>
<%= render_filter nil, "tbody_writing_journals" %>
<table class="table main-list"> <table class="table main-list">
<thead> <thead>
<tr> <tr>