Class: Eivid::VideosController

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

Instance Method Summary collapse

Instance Method Details

#destroyObject



32
33
34
35
# File 'app/controllers/eivid/videos_controller.rb', line 32

def destroy
  record = RequestService.destroy(video: @video)
  render json: record
end

#indexObject



24
25
26
# File 'app/controllers/eivid/videos_controller.rb', line 24

def index
  render json: Video.all
end

#owner_videosObject



20
21
22
# File 'app/controllers/eivid/videos_controller.rb', line 20

def owner_videos
  render json: @owner.videos
end

#showObject



28
29
30
# File 'app/controllers/eivid/videos_controller.rb', line 28

def show
  render json: @video
end

#upload_videoObject



15
16
17
18
# File 'app/controllers/eivid/videos_controller.rb', line 15

def upload_video
  record = UploadService.upload(owner: @owner, user: @user, video_file: video_params["video_file"], video_title: video_title)   
  render json: record
end