Sha256: c8b92806b588e54b9ea2ae217ebb3fe70a55172e31865e91fb58865aad8d3557
Contents?: true
Size: 739 Bytes
Versions: 3
Compression:
Stored size: 739 Bytes
Contents
require_dependency "ishapi/application_controller" module Ishapi class GalleriesController < ApplicationController def index @galleries = Gallery.all authorize! :index, Gallery if params[:cityname] city = City.find_by :cityname => params[:cityname] @galleries = @galleries.where( :city => city ) end if params[:domain] @site = Site.find_by( :domain => params[:domain], :lang => 'en' ) @galleries = @galleries.where( :site => @site ) end @galleries = @galleries.page( params[:galleries_page] ).per( 10 ) end def show @gallery = ::Gallery.unscoped.find_by :galleryname => params[:galleryname] authorize! :show, @gallery end end end
Version data entries
3 entries across 3 versions & 1 rubygems