small fix for updating unit

This commit is contained in:
Harry Bomrah 2016-01-07 15:36:01 +08:00
parent 51e462d13c
commit 29ba525e69
1 changed files with 1 additions and 1 deletions

View File

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