Sha256: 37654da81e1f0848bf3c151addde5dd11a0a22b5052f37587c2eb29257da1c6c
Contents?: true
Size: 735 Bytes
Versions: 12
Compression:
Stored size: 735 Bytes
Contents
require_dependency "ishapi/application_controller" module Ishapi class SitesController < ApplicationController def index authorize! :index, ::Site @sites = ::Site.all end def show if params[:domain].include?(".json") domain = params[:domain][0...-5] else domain = params[:domain] end @site = ::Site.find_by :domain => domain, :lang => :en authorize! :show, @site @galleries = @site.galleries.limit( 10 ) @newsitems = @site.newsitems.limit(10) @reports = @site.reports.limit( 10 ) @langs = ::Site.where( :domain => domain ).map( &:lang ) @feature_tags = @site.tags.where( :is_feature => true ) end end end
Version data entries
12 entries across 12 versions & 1 rubygems