Class: Ishapi::VideosController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Ishapi::VideosController
- Defined in:
- app/controllers/ishapi/videos_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
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 :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] :show, @video end |