From 92a08dc606960674104bc199adb2ee910ab2231b Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 1 Apr 2016 09:37:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A500=E9=97=AE=E9=A2=98=20admin?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=BC=96=E8=BE=91500=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 7 ++++++- app/views/admin/homework.html.erb | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 280957449..920b9f2c4 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -41,7 +41,12 @@ class OrganizationsController < ApplicationController end def edit - @organization = Organization.find(params[:id]) + # @organization = Organization.find(params[:id]) + begin + @organization = Organization.where("id =?", params[:id]) + ensure + render_404 + end end def destroy diff --git a/app/views/admin/homework.html.erb b/app/views/admin/homework.html.erb index 4188fecea..09f42bb84 100644 --- a/app/views/admin/homework.html.erb +++ b/app/views/admin/homework.html.erb @@ -35,7 +35,7 @@ <%=@count %> - <%=link_to(homework.name, student_work_index_path(:homework => homework.id))%> + <%=link_to(homework.try(:name), student_work_index_path(:homework => homework.id))%> <%= link_to(homework.course.name, course_path(homework.course.id)) %>