Class: Spina::Admin::MediaFoldersController

Inherits:
AdminController show all
Defined in:
app/controllers/spina/admin/media_folders_controller.rb

Instance Method Summary collapse

Methods inherited from AdminController

#current_admin_path

Instance Method Details

#createObject



18
19
20
21
22
# File 'app/controllers/spina/admin/media_folders_controller.rb', line 18

def create
  @media_folder = MediaFolder.new(media_folder_params)
  @media_folder.save
  redirect_to spina.admin_images_path
end

#destroyObject



24
25
26
27
28
# File 'app/controllers/spina/admin/media_folders_controller.rb', line 24

def destroy
  @media_folder = MediaFolder.find(params[:id])
  @media_folder.destroy
  redirect_to spina.admin_images_path
end

#newObject



6
7
8
# File 'app/controllers/spina/admin/media_folders_controller.rb', line 6

def new
  @media_folder = MediaFolder.new
end

#showObject



10
11
12
13
14
15
16
# File 'app/controllers/spina/admin/media_folders_controller.rb', line 10

def show
  add_breadcrumb I18n.t('spina.website.media_library'), admin_media_library_path
  add_breadcrumb I18n.t('spina.website.images'), spina.admin_images_path
  @media_folder = MediaFolder.find(params[:id])
  add_breadcrumb @media_folder.name
  @images = @media_folder.images.sorted.page(params[:page])
end