From ca6deabb340916e7a2588386d56e3d43506a6171 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sat, 1 Aug 2015 00:03:01 +0200 Subject: [PATCH] AutoCommit Sam Aug 1 00:03:01 CEST 2015 --- app/controllers/comments_controller.rb | 3 ++- app/views/comments/_form.html.erb | 24 ++++++++++++------------ app/views/comments/create.js.erb | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index b6aeb7b..4ab2988 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -22,7 +22,8 @@ num = {"Beispiel"=> 2, "Survey::Question"=> 7} respond_to do |format| - format.html # show.html.erb +# format.html # show.html.erb + format.js format.json { render json: @comment } end end diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb index 0f9d2c8..d4499d0 100644 --- a/app/views/comments/_form.html.erb +++ b/app/views/comments/_form.html.erb @@ -1,14 +1,14 @@
- <%= semantic_form_for form , remote:true, html: {class: "form-inline"} do |f| %> - <%= f.inputs do %> - <%= f.input :commentable_id, as: :hidden %> - <%= f.input :commentable_type, as: :hidden %> - <%= f.input :text, as: :string %> - <%= f.input :anonym %> - <% end %> - - <%= f.actions do %> - <%= f.action :submit, :as => :input %> - <% end %> -<% end %> + <%= semantic_form_for form , remote: true, html: {class: "form-inline"} do |f| %> + <%= f.inputs do %> + <%= f.input :commentable_id, as: :hidden %> + <%= f.input :commentable_type, as: :hidden %> + <%= f.input :text, as: :string %> + <%= f.input :anonym %> + <% end %> + + <%= f.actions do %> + <%= f.action :submit, :as => :input %> + <% end %> + <% end %>
diff --git a/app/views/comments/create.js.erb b/app/views/comments/create.js.erb index 8b13789..1a20c2e 100644 --- a/app/views/comments/create.js.erb +++ b/app/views/comments/create.js.erb @@ -1 +1 @@ - +$("#<%= @comment.commentable.formid %>").html("")