Sha256: 2da56592959447eed589880fe4fbbf9a872d5d355b5a147dac52388ec890741e

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

#
# ishapi / features / _index
#

resource ||= site if defined? site
resource ||= city if defined? city

json.n_features features.count
json.features do
  json.array! features.limit( resource.n_features ) do |feature|

    json.name       feature.name       unless feature.name.blank?
    json.subhead    feature.subhead    unless feature.subhead.blank?
    json.link_path  feature.link_path  unless feature.link_path.blank?
    json.inner_html feature.inner_html unless feature.inner_html.blank?
    json.photo_url  feature.image_path unless feature.image_path.blank?
    
    if feature.report
      r = feature.report
      json.name       r.name
      json.subhead    r.subhead
      json.reportname r.name_seo
      if r.photo
        json.photo_url  r.photo.photo.url( :thumb )
      end
    end
    
    if feature.gallery
      r = feature.gallery
      json.name        r.name
      json.subhead     r.subhead
      json.galleryname r.galleryname
      if r.photos[0]
        json.photo_url r.photos[0].photo.url( :thumb )
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ishapi-0.1.8.31 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.30 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.29 app/views/ishapi/features/_index.jbuilder