Class: Ishapi::VideosController

Inherits:
ApplicationController show all
Defined in:
app/controllers/ishapi/videos_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#exception, #home, #long_term_token, #vote

Instance Method Details

#indexObject



10
11
12
13
14
# File 'app/controllers/ishapi/videos_controller.rb', line 10

def index
  authorize! :index, Video
  @videos = Video.all.published
  @videos = @videos.page( params[:videos_page] ).per( 10 )
end

#showObject



5
6
7
8
# File 'app/controllers/ishapi/videos_controller.rb', line 5

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