def update
      upsert do
        # NOTE:
        # 1. update ++then++ valid to set new values in @record to draw form.
        # 1. user_scoped may have joins so that record could be
        #    ActiveRecord::ReadOnlyRecord so that's why access again from
        #    model.
        @record  = model.find(user_scoped.find(params[:id]).id)
       #upsert_files
        if !@record.update_attributes(permitted_params(:update))
          raise ActiveRecord::RecordInvalid.new(@record)
        end
      end
    end
def update
      upsert do
        # NOTE:
        # 1. update ++then++ valid to set new values in @record to draw form.
        # 1. user_scoped may have joins so that record could be
        #    ActiveRecord::ReadOnlyRecord so that's why access again from
        #    model.
        @record  = model.find(user_scoped.find(params[:id]).id)
       #upsert_files
        if !@record.update_attributes(permitted_params(:update))
          raise ActiveRecord::RecordInvalid.new(@record)
        end
      end
    end
save existence modified record

 === Permission
 ModelPermission::UPDATE on this controller is required.