Sha256: 1601fb5db2aef13d6a833b7abbde9ff1ed71cab02c3338d845cf1f719c4930e4

Contents?: true

Size: 693 Bytes

Versions: 36

Compression:

Stored size: 693 Bytes

Contents

require_dependency "ishapi/application_controller"
module Ishapi
  class VideosController < ApplicationController

    def show
      @video = Video.unscoped.find_by :slug => params[:slug]
      authorize! :show, @video
    end

    def index
      authorize! :index, Video
      @videos = Video.all
      if params[:cityname]
        city = City.find_by :cityname => params[:cityname]
        @videos = @videos.where( :city_id => city.id )
      end
      if params[:domain]
        site = Site.find_by :domain => params[:domain], :lang => :en
        @videos = @videos.where( :site_id => site.id )
      end

      @videos = @videos.page( params[:videos_page] ).per( 10 )
    end

  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
ishapi-0.1.8.194 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.193 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.192 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.191 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.190 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.189 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.188 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.187 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.185 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.184 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.183 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.182 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.181 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.180 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.178 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.177 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.176 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.175 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.174 app/controllers/ishapi/videos_controller.rb
ishapi-0.1.8.173 app/controllers/ishapi/videos_controller.rb