Module: RestfulController::Actions::Update

Defined in:
lib/restful_controller/actions/update.rb

Instance Method Summary collapse

Instance Method Details

#updateObject



4
5
6
7
8
9
10
# File 'lib/restful_controller/actions/update.rb', line 4

def update
  if instance_variable_get("@#{self.class.model_name}").update_attributes(model_params)
    redirect_to instance_variable_get("@#{self.class.model_name}"), notice: "Was successfully updated."
  else
    render action: 'edit'
  end
end