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 @@ -