Class: Refinery::ImageSlideshows::Admin::ImageSlidesController
- Inherits:
-
AdminController
- Object
- AdminController
- Refinery::ImageSlideshows::Admin::ImageSlidesController
- Defined in:
- app/controllers/refinery/image_slideshows/admin/image_slides_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/refinery/image_slideshows/admin/image_slides_controller.rb', line 15 def create @image_slide.position = (Refinery::ImageSlideshows::ImageSlide.maximum(:position) || 0) + 1 if @image_slide.valid? && @image_slide.save redirect_to , :notice => 'Image slide was successfully created.' else render :action => :new end end |
#destroy ⇒ Object
33 34 35 36 37 |
# File 'app/controllers/refinery/image_slideshows/admin/image_slides_controller.rb', line 33 def destroy if @image_slide.destroy redirect_to , :notice => 'Image slide was successfully deleted.' end end |
#index ⇒ Object
11 12 13 |
# File 'app/controllers/refinery/image_slideshows/admin/image_slides_controller.rb', line 11 def index end |
#update ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/controllers/refinery/image_slideshows/admin/image_slides_controller.rb', line 25 def update if @image_slide.update_attributes(params[:image_slide]) redirect_to , :notice => 'Image slide was successfully updated.' else render :action => :edit end end |