评论回复不能为空
This commit is contained in:
parent
c8a4970f73
commit
23a457af9e
|
@ -177,9 +177,12 @@ class StudentWorkController < ApplicationController
|
|||
@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|
|
||||
format.js
|
||||
end
|
||||
@status = 1
|
||||
else
|
||||
@status = 2
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,2 +1,6 @@
|
|||
$("#add_score_reply_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'add_score_reply', :locals => {:score => @score}) %>");
|
||||
$("#replay_histroy_<%= @score.id%>").prepend("<%= escape_javascript(render :partial => 'jour_replay', :locals => {:jour => @jour}) %>");
|
||||
<% if @status && @status == 1%>
|
||||
$("#replay_histroy_<%= @score.id%>").prepend("<%= escape_javascript(render :partial => 'jour_replay', :locals => {:jour => @jour}) %>");
|
||||
<% else%>
|
||||
alert("回复内容不能为空");
|
||||
<% end%>
|
Loading…
Reference in New Issue