Sha256: 59d48edd794f0033d6a07b84bdada0569ee22eff4ad9a7cd63fed79edcdcca00

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

#
# ishapi / maps / show
#

this_key = [ @map, params.permit! ]
json.cache! this_key do
  json.map do
    json.id          @map.id.to_s
    json.slug        @map.slug
    json.parent_slug @map.parent_slug
    json.description @map.description
    json.w           @map.w
    json.h           @map.h
    json.img_path    @map.image.image.url(:original)
    json.updated_at  @map.updated_at

    if @map.map
      json.partial! 'ishapi/maps/show', map: @map.map
    end

    json.breadcrumbs do
      json.array! @map.breadcrumbs do |b|
        json.name b[:name]
        json.slug b[:slug]
        json.link b[:link]
      end
    end

    ## I removed json parsing from here! _vp_ 2021-10-14
    if @map.parent_slug.present?
      json.config @map.parent.config
      json.labels @map.parent.labels
    else
      json.config @map.config
      json.labels @map.labels
    end

    json.partial! 'ishapi/markers/index', map: @map

    puts! @newsitems, 'these first'
    if @newsitems
      json.partial! 'ishapi/newsitems/index', :newsitems => @newsitems
    end

    if @galleries
      json.partial! 'ishapi/galleries/index', galleries: @galleries
    end

  end
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ishapi-0.1.8.156 app/views/ishapi/maps/show.jbuilder
ishapi-0.1.8.155 app/views/ishapi/maps/show.jbuilder