Sha256: 647cae4887ecbb7be927d108258b71d0247160f322373f60caccdffd585ec93b
Contents?: true
Size: 565 Bytes
Versions: 20
Compression:
Stored size: 565 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 @newsitems = @site.newsitems.limit(10) @langs = ::Site.where( :domain => domain ).map( &:lang ) end end end
Version data entries
20 entries across 20 versions & 1 rubygems