Class: Gaggle::GoosesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Gaggle::GoosesController
- Defined in:
- app/controllers/gaggle/gooses_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 |
# File 'app/controllers/gaggle/gooses_controller.rb', line 13 def create @goose.assign_attributes(goose_params) if @goose.save redirect_to @goose, notice: "Goose was successfully created." else render :new end end |
#destroy ⇒ Object
32 33 34 35 |
# File 'app/controllers/gaggle/gooses_controller.rb', line 32 def destroy @goose.destroy redirect_to root_url, notice: "Goose was successfully destroyed." end |
#edit ⇒ Object
22 |
# File 'app/controllers/gaggle/gooses_controller.rb', line 22 def edit; end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/gaggle/gooses_controller.rb', line 5 def index @gooses = Goose.where.not(id: Current.goose_user&.id) end |
#new ⇒ Object
11 |
# File 'app/controllers/gaggle/gooses_controller.rb', line 11 def new; end |
#show ⇒ Object
9 |
# File 'app/controllers/gaggle/gooses_controller.rb', line 9 def show; end |
#update ⇒ Object
24 25 26 27 28 29 30 |
# File 'app/controllers/gaggle/gooses_controller.rb', line 24 def update if @goose.update(goose_params) redirect_to @goose, notice: "Goose was successfully updated." else render :edit end end |