Class: Admin::PhotoGalleriesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/photo_galleries_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



22
23
24
25
26
# File 'app/controllers/admin/photo_galleries_controller.rb', line 22

def create
  @photo_gallery = SpudPhotoGallery.new(photo_gallery_params)
  flash[:notice] = 'Gallery created successfully' if @photo_gallery.save
  respond_with @photo_gallery, location: admin_photo_galleries_path
end

#destroyObject



38
39
40
41
# File 'app/controllers/admin/photo_galleries_controller.rb', line 38

def destroy
  flash.now[:notice] = 'Gallery deleted successfully' if @photo_gallery.destroy
  respond_with @photo_gallery, location: admin_photo_galleries_path
end

#editObject



28
29
30
# File 'app/controllers/admin/photo_galleries_controller.rb', line 28

def edit
  respond_with @photo_gallery
end

#indexObject



8
9
10
11
# File 'app/controllers/admin/photo_galleries_controller.rb', line 8

def index
  @photo_galleries = SpudPhotoGallery.all
  respond_with @photo_galleries
end

#newObject



17
18
19
20
# File 'app/controllers/admin/photo_galleries_controller.rb', line 17

def new
  @photo_gallery = SpudPhotoGallery.new
  respond_with @photo_gallery
end

#showObject



13
14
15
# File 'app/controllers/admin/photo_galleries_controller.rb', line 13

def show
  respond_with @photo_gallery
end

#updateObject



32
33
34
35
36
# File 'app/controllers/admin/photo_galleries_controller.rb', line 32

def update
  @photo_gallery.update_attributes(photo_gallery_params)
  flash[:notice] = 'Gallery updated successfully' if @photo_gallery.save
  respond_with @photo_gallery, location: admin_photo_galleries_path
end