diff --git a/app/controllers/admin/news_admins_controller.rb b/app/controllers/admin/news_admins_controller.rb index 062b35b..a1f1b88 100644 --- a/app/controllers/admin/news_admins_controller.rb +++ b/app/controllers/admin/news_admins_controller.rb @@ -28,7 +28,7 @@ class Admin::NewsAdminsController < OrbitAdminController end def update - @unit = Unit.where(:uid => params[:id].split("-").last) rescue nil + @unit = Unit.where(:uid => params[:id].split("-").last).first rescue nil @unit.update_attributes(unit_params) #if !@unit.nil? redirect_to admin_news_admins_path