Module: GardenVariety::DestroyAction
- Defined in:
- lib/garden_variety/actions.rb
Instance Method Summary collapse
-
#destroy ⇒ void
Garden variety controller
destroyaction.
Instance Method Details
#destroy ⇒ void #destroy { ... } ⇒ void
This method returns an undefined value.
Garden variety controller destroy action.
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/garden_variety/actions.rb', line 83 def destroy self.model = (model = (find_model)) if model.destroy flash[:success] = (:success) block_given? ? yield : redirect_to(action: :index) flash.discard(:success) if REDIRECT_CODES.exclude?(response.status) else flash.now[:error] = (:error) render :show end end |