Class: Munificent::Admin::FundraisersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Munificent::Admin::FundraisersController
- Defined in:
- app/controllers/munificent/admin/fundraisers_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
13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/munificent/admin/fundraisers_controller.rb', line 13 def create if @fundraiser.save flash[:notice] = "Fundraiser created" redirect_to edit_fundraiser_path(@fundraiser) else flash[:alert] = @fundraiser.errors..join(", ") redirect_to new_fundraiser_path end end |
#destroy ⇒ Object
35 36 37 38 |
# File 'app/controllers/munificent/admin/fundraisers_controller.rb', line 35 def destroy @fundraiser.destroy redirect_to fundraisers_path end |
#edit ⇒ Object
11 |
# File 'app/controllers/munificent/admin/fundraisers_controller.rb', line 11 def edit; end |
#index ⇒ Object
8 |
# File 'app/controllers/munificent/admin/fundraisers_controller.rb', line 8 def index; end |
#new ⇒ Object
10 |
# File 'app/controllers/munificent/admin/fundraisers_controller.rb', line 10 def new; end |
#show ⇒ Object
9 |
# File 'app/controllers/munificent/admin/fundraisers_controller.rb', line 9 def show; end |
#update ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/munificent/admin/fundraisers_controller.rb', line 23 def update @fundraiser.assign_attributes(fundraiser_params) if @fundraiser.save flash[:notice] = "Fundraiser saved" else flash[:alert] = @fundraiser.errors..join(", ") end redirect_to edit_fundraiser_path(@fundraiser) end |