AutoCommit Sam Aug 1 01:03:01 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-08-01 01:03:01 +02:00
parent ca6deabb34
commit d5571b38fa
2 changed files with 4 additions and 2 deletions

View File

@@ -54,10 +54,11 @@ num = {"Beispiel"=> 2, "Survey::Question"=> 7}
if @comment if @comment
format.html { redirect_to @comment.commentable, notice: 'Comment was successfully created.', show_comments: true } format.html { redirect_to @comment.commentable, notice: 'Comment was successfully created.', show_comments: true }
format.json { render json: @comment, status: :created, location: @comment } format.json { render json: @comment, status: :created, location: @comment }
format.js
else else
format.html { render action: "new" } format.html { render action: "new" }
format.json { render json: @comment.errors, status: :unprocessable_entity } format.json { render json: @comment.errors, status: :unprocessable_entity }
format.js {render action:"new"}
end end
end end
end end

View File

@@ -1 +1,2 @@
$("#<%= @comment.commentable.formid %>").html("") $("#<%= Comment.formid_for(@comment.parent) %>").html("")
$("#<%= Comment.wrapid_for(@comment.commentable) %>").html("<%= escape_javascript render partial:"comments/comments", object: @comments %>")