Class: Ishapi::VideosController
Instance Method Summary
collapse
#home, #long_term_token, #test
Instance Method Details
#index ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'app/controllers/ishapi/videos_controller.rb', line 10
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
|
#show ⇒ Object
5
6
7
8
|
# File 'app/controllers/ishapi/videos_controller.rb', line 5
def show
@video = Video.unscoped.find_by :name_seo => params[:name_seo]
authorize! :show, @video
end
|