forked from Gitlink/forgeplus
修改issues返回count
This commit is contained in:
parent
1e9716b84a
commit
b9c12d8f5d
|
@ -7,9 +7,13 @@ class JournalsController < ApplicationController
|
|||
def index
|
||||
@page = params[:page] || 1
|
||||
@limit = params[:limit] || 10
|
||||
journals = @issue.journals.journal_includes.order("created_on desc")
|
||||
@journals_size = journals.size
|
||||
@journals = journals.parent_journals.page(@page).per(@limit)
|
||||
total_journals = @issue.journals.journal_includes
|
||||
@jounals_total = total_journals.size
|
||||
parent_journals =journals.parent_journals.order("created_on desc")
|
||||
@journals = parent_journals.order("created_on desc").page(@page).per(@limit)
|
||||
@journals_size = parent_journals.size
|
||||
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
json.partial! "commons/success"
|
||||
json.limit @limit
|
||||
json.journals_count @journals_size
|
||||
json.journals_total_count @jounals_total
|
||||
json.issue_journals do
|
||||
json.array! @journals do |journal|
|
||||
json.partial! "journals/journal_item", journal: journal
|
||||
|
|
Loading…
Reference in New Issue