def update(options = {}, &block)
      object = get_resource_ivar || find_and_update_resource

      options[:location] = collection_path if object.errors.empty?

      respond_with_dual(object, options, &block)
    end
def update(options = {}, &block)
      object = get_resource_ivar || find_and_update_resource

      options[:location] = collection_path if object.errors.empty?

      respond_with_dual(object, options, &block)
    end
update action, finds an object based on the passed id, if no object is
 found an ActiveRecord::RecordNotFound is raised. If the record is found
 then it's updated from params using ActiveRecord update_attributes method
 and an instance variable is set with the object, variable name is based
 on the model name set in the restful macro.

 If update_attributes fail, then edit form is displayed, and the instance
 variable can be accessed in teh form using the resource helper method.

 If update_attributes success, a redirect to the index action is made.