Class: Ishapi::ReportsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Ishapi::ReportsController
- Defined in:
- app/controllers/ishapi/reports_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/ishapi/reports_controller.rb', line 10 def index :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 @reports = @reports.page( params[:reports_page] ).per( 10 ) end |
#show ⇒ Object
5 6 7 8 |
# File 'app/controllers/ishapi/reports_controller.rb', line 5 def show @report = Report.unscoped.find_by :name_seo => params[:name_seo] :show, @report end |