From fea784cbccd82c6b474b5b63d758475549391d5d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 27 May 2015 15:11:11 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E8=AF=84=E5=88=86?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E8=B7=AF=E7=94=B1=E6=94=B9=E5=8F=98=202?= =?UTF-8?q?=E3=80=81=E5=88=A0=E9=99=A4=E5=9B=9E=E5=A4=8D=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=8F=8A=E7=95=8C=E9=9D=A2=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 10 ++++++---- app/views/student_work/_add_score_reply.html.erb | 2 +- app/views/student_work/_jour_replay.html.erb | 2 +- app/views/student_work/destroy_score_reply.js.erb | 1 + config/routes.rb | 4 ++-- public/stylesheets/courses.css | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 app/views/student_work/destroy_score_reply.js.erb diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 98ebc0705..63ab4d0f0 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -103,7 +103,7 @@ class StudentWorkController < ApplicationController #添加评分的回复 def add_score_reply - @score = StudentWorksScore.find params[:id] + @score = StudentWorksScore.find params[:score_id] @jour = @score.journals_for_messages.new(:user_id => User.current.id,:notes =>params[:message], :reply_id => 0) if @jour.save respond_to do |format| @@ -114,9 +114,11 @@ class StudentWorkController < ApplicationController #删除评分的回复 def destroy_score_reply - - respond_to do |format| - format.js + @jour = JournalsForMessage.find params[:jour_id] + if @jour.destroy + respond_to do |format| + format.js + end end end diff --git a/app/views/student_work/_add_score_reply.html.erb b/app/views/student_work/_add_score_reply.html.erb index 99e9c3793..2866b2da6 100644 --- a/app/views/student_work/_add_score_reply.html.erb +++ b/app/views/student_work/_add_score_reply.html.erb @@ -1,4 +1,4 @@ -<%= form_for('', :remote => true, :method => :post,:url => add_score_reply_student_work_path(score.id)) do |f|%> +<%= form_for('', :remote => true, :method => :post,:url => add_score_reply_student_work_index_path(:score_id => score.id)) do |f|%> <%= f.text_area 'message', :class => 'ping_text', :placeholder => l(:text_caracters_maximum,:count=>250),:maxlength => 250 %> 回复 <% end%> \ No newline at end of file diff --git a/app/views/student_work/_jour_replay.html.erb b/app/views/student_work/_jour_replay.html.erb index d673fb8b0..77fb476bf 100644 --- a/app/views/student_work/_jour_replay.html.erb +++ b/app/views/student_work/_jour_replay.html.erb @@ -1,4 +1,4 @@ -