Class: FlyAdmin::VideosController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#authenticate_admin!

Instance Method Details

#createObject

POST /videos



28
29
30
31
32
33
34
35
36
# File 'app/controllers/fly_admin/videos_controller.rb', line 28

def create
  @video = Video.new(video_params)

  if @video.save
    redirect_to @video, notice: 'Video was successfully created.'
  else
    render :new
  end
end

#destroyObject

DELETE /videos/1



48
49
50
51
# File 'app/controllers/fly_admin/videos_controller.rb', line 48

def destroy
  @video.destroy
  redirect_to videos_url, notice: 'Видео успешно удалено!!!!'
end

#editObject

GET /videos/1/edit



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

def edit
end

#indexObject

GET /videos



8
9
10
11
12
# File 'app/controllers/fly_admin/videos_controller.rb', line 8

def index
  if request.post? || redirected_after_uploading?
    filter_results
  end
end

#newObject

GET /videos/new



19
20
21
# File 'app/controllers/fly_admin/videos_controller.rb', line 19

def new
  @video = Video.new
end

#showObject

GET /videos/1



15
16
# File 'app/controllers/fly_admin/videos_controller.rb', line 15

def show
end

#updateObject

PATCH/PUT /videos/1



39
40
41
42
43
44
45
# File 'app/controllers/fly_admin/videos_controller.rb', line 39

def update
  if @video.update(video_params)
    redirect_to @video, notice: 'Video was successfully updated.'
  else
    render :edit
  end
end