Module: GardenVariety::UpdateAction
- Defined in:
- lib/garden_variety/actions.rb
Instance Method Summary collapse
-
#update ⇒ void
Garden variety controller
updateaction.
Instance Method Details
#update ⇒ void #update { ... } ⇒ void
This method returns an undefined value.
Garden variety controller update action.
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/garden_variety/actions.rb', line 64 def update self.model = (model = assign_attributes((find_model))) if model.save flash[:success] = (:success) block_given? ? yield : redirect_to(model) flash.discard(:success) if REDIRECT_CODES.exclude?(response.status) else flash.now[:error] = (:error) render :edit end end |