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



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

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



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

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

#editObject



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

def edit
  respond_with @photo_gallery
end

#indexObject



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

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

#newObject



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

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

#showObject



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

def show
  respond_with @photo_gallery
end

#updateObject



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

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