parent
7125e71563
commit
e7723a6003
@ -0,0 +1,12 @@
|
||||
class Weapps::HomesController < Weapps::BaseController
|
||||
def show
|
||||
# banner图
|
||||
@images = PortalImage.where(status: true).order(position: :asc)
|
||||
|
||||
# 热门实训
|
||||
@shixuns = Shixun.where(homepage_show: true).includes(:tag_repertoires, :challenges).limit(4)
|
||||
|
||||
# 热门实践课程
|
||||
@subjects = Subject.where(homepage_show: true).includes(:shixuns, :repertoire).limit(4)
|
||||
end
|
||||
end
|
@ -0,0 +1,14 @@
|
||||
json.images do
|
||||
json.array! @images do |image|
|
||||
json.path image.link
|
||||
json.image_url Util::FileManage.source_disk_file_url(image)
|
||||
end
|
||||
end
|
||||
|
||||
json.shixuns do
|
||||
json.partial! 'shixuns/shixun', locals: { shixuns: @shixuns }
|
||||
end
|
||||
|
||||
json.subjects do
|
||||
json.partial! 'subjects/subject', locals: { subjects: @subjects }
|
||||
end
|
Loading…
Reference in new issue