测试项目分页

This commit is contained in:
sylor_huang@126.com 2020-04-22 11:26:31 +08:00
parent 6cb7a3113d
commit 9101266f01
1 changed files with 13 additions and 1 deletions

View File

@ -1,7 +1,19 @@
json.total_count @total_count
json.projects do
json.array! @projects.to_a do |project|
json.partial! 'project', project: project
json.id project.id
json.identifier project.identifier
json.name project.name
json.description Nokogiri::HTML(project.description).text
json.visits project.visits
json.praises_count project.praises_count
json.forked_count project.forked_count
json.is_public project.is_public
json.mirror_url project.repository&.mirror_url
json.last_update_time render_unix_time(project.updated_on)
json.time_ago time_from_now(project.updated_on)
json.forked_from_project_id project.forked_from_project_id
# json.partial! 'project', project: project
json.author do
json.name project.owner.try(:show_real_name)
json.login project.owner.login