Sha256: 905250f21ef06e8d7c1f8985df4292ea377f9e8c8ae8fbea9d07dbcf2fcf4f88

Contents?: true

Size: 1.08 KB

Versions: 110

Compression:

Stored size: 1.08 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?
    json.created_at feature.created_at
    
    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

110 entries across 110 versions & 1 rubygems

Version Path
ishapi-0.1.8.154 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.153 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.151 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.150 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.149 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.148 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.147 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.146 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.145 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.144 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.143 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.142 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.141 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.140 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.139 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.138 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.137 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.136 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.135 app/views/ishapi/features/_index.jbuilder
ishapi-0.1.8.134 app/views/ishapi/features/_index.jbuilder