forked from saurabh/personal-journal
add backend search feature
This commit is contained in:
parent
a0e5539620
commit
5d14333c33
|
@ -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
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue