Use ajax form for artist commentary

This prevents the parameters (eg. ?tags=whatever) from being eaten on
submit.
This commit is contained in:
Toks
2013-11-21 21:07:45 -05:00
parent 7946002cd2
commit 2a0910ca11
3 changed files with 3 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ class ArtistCommentariesController < ApplicationController
@artist_commentary = ArtistCommentary.create(params[:artist_commentary])
end
respond_with(@artist_commentary.post)
respond_with(@artist_commentary)
end
def revert

View File

@@ -1,6 +1,6 @@
<p>If the artist of this image posted some interesting additional information about this work, you can copy it here.</p>
<%= form_tag(create_or_update_artist_commentaries_path, :class => "simple_form", :method => :put) do %>
<%= form_tag(create_or_update_artist_commentaries_path(:format => :js), :remote => true, :class => "simple_form", :method => :put) do %>
<div class="input">
<%= hidden_field :artist_commentary, :post_id, :value => @post.id %>

View File

@@ -0,0 +1 @@
location.reload();