Class: Admin::Carousel::CarouselsController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::Carousel::CarouselsController
- Defined in:
- app/controllers/admin/carousel/carousels_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/admin/carousel/carousels_controller.rb', line 18 def create @carousel.save! flash[:notice] = 'Carousel created' redirect_to (@carousel) rescue ActiveRecord::RecordInvalid flash.now[:error] = 'Failed to create Carousel' render :action => :new end |
#destroy ⇒ Object
38 39 40 41 42 |
# File 'app/controllers/admin/carousel/carousels_controller.rb', line 38 def destroy @carousel.destroy flash[:notice] = 'Carousel removed' redirect_to :action => :index end |
#edit ⇒ Object
14 15 16 |
# File 'app/controllers/admin/carousel/carousels_controller.rb', line 14 def edit render end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/admin/carousel/carousels_controller.rb', line 6 def index @carousels = Carousel::Carousel.all end |
#new ⇒ Object
10 11 12 |
# File 'app/controllers/admin/carousel/carousels_controller.rb', line 10 def new render end |
#update ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/admin/carousel/carousels_controller.rb', line 28 def update @carousel.update_attributes!(params[:carousel]) flash[:notice] = 'Carousel updated' redirect_to :action => :edit, :id => @carousel rescue ActiveRecord::RecordInvalid flash.now[:error] = 'Failed to update Carousel' render :action => :edit end |