update issue fix for nccu

This commit is contained in:
Harry Bomrah 2015-09-24 14:41:47 +08:00
parent fc35327d11
commit a220e6e910
1 changed files with 2 additions and 2 deletions

View File

@ -28,8 +28,8 @@ class Admin::NewsAdminsController < OrbitAdminController
end
def update
@unit = Unit.find(params[:id])
@unit.update_attributes(unit_params)
@unit = Unit.find_by(:uid => params[:id].split("-").last) rescue nil
@unit.update_attributes(unit_params) if !@unit.nil?
redirect_to admin_news_admins_path
end