Sha256: 8b9821bc35ee06fe27a585076c5d064a202dec199c3b43b5b4e06c1d80f3da1c
Contents?: true
Size: 840 Bytes
Versions: 52
Compression:
Stored size: 840 Bytes
Contents
require_dependency "ishapi/application_controller" module Ishapi class ReportsController < ApplicationController def show @report = Report.unscoped.find_by :slug => params[:slug] authorize! :show, @report end def index authorize! :index, Report @reports = Report.all if params[:cityname] city = City.find_by :cityname => params[:cityname] @reports = @reports.where( :city_id => city.id ) end if params[:domain] site = Site.find_by :domain => params[:domain], :lang => :en @reports = @reports.where( :site_id => site.id ) end if params[:tag] tag = Tag.find_by(:name => params[:tag]) @reports = @reports.where(:tag_ids => tag) end @reports = @reports.page( params[:reports_page] ).per( 10 ) end end end
Version data entries
52 entries across 52 versions & 1 rubygems