Class: Admin::BannerSetsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::BannerSetsController
- Defined in:
- app/controllers/admin/banner_sets_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/admin/banner_sets_controller.rb', line 23 def create @banner_set = SpudBannerSet.new() if @banner_set.save flash.now[:notice] = 'BannerSet created successfully' render 'create' else render 'new', :status => 422 end end |
#destroy ⇒ Object
46 47 48 49 50 51 |
# File 'app/controllers/admin/banner_sets_controller.rb', line 46 def destroy if @banner_set.destroy flash.now[:notice] = 'BannerSet deleted successfully' end render :nothing => true end |
#edit ⇒ Object
33 34 35 |
# File 'app/controllers/admin/banner_sets_controller.rb', line 33 def edit respond_with @banner_set end |
#index ⇒ Object
9 10 11 12 |
# File 'app/controllers/admin/banner_sets_controller.rb', line 9 def index @banner_sets = SpudBannerSet.all respond_with @banner_sets, :layout => 'admin/detail' end |
#new ⇒ Object
18 19 20 21 |
# File 'app/controllers/admin/banner_sets_controller.rb', line 18 def new @banner_set = SpudBannerSet.new respond_with @banner_set end |
#show ⇒ Object
14 15 16 |
# File 'app/controllers/admin/banner_sets_controller.rb', line 14 def show respond_with @banner_set, :layout => 'admin/detail' end |
#update ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'app/controllers/admin/banner_sets_controller.rb', line 37 def update if @banner_set.update_attributes() flash.now[:notice] = 'BannerSet updated successfully' render 'create' else render 'edit', :status => 422 end end |