diff --git a/app/controllers/archives_controller.rb b/app/controllers/archives_controller.rb index 11b0e7f..7d31986 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -28,7 +28,7 @@ class ArchivesController < ApplicationController respond_to do |format| format.json do - render :json => { + render :json => { posts: @posts.collect { |post| build_summary(post) }, start_with: start_with } @@ -49,7 +49,7 @@ class ArchivesController < ApplicationController def build_summary(post) { title: post.title, - type: post.type, + type: post.type_en, created_at: format_date(post.created_at), id: post.id.to_s, liked_count: post.liked_count, diff --git a/app/views/archives/index.html.slim b/app/views/archives/index.html.slim index 01181a9..e929fc8 100644 --- a/app/views/archives/index.html.slim +++ b/app/views/archives/index.html.slim @@ -12,7 +12,7 @@ |{{ post.created_at }} i.fi-list-thumbnails span - |{{ post.type_en }} + |{{ post.type }} i.fi-pricetag-multiple span |{{ post.labels }}