Use ajax form for artist commentary
This prevents the parameters (eg. ?tags=whatever) from being eaten on submit.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
|
||||
1
app/views/artist_commentaries/create_or_update.js.erb
Normal file
1
app/views/artist_commentaries/create_or_update.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
location.reload();
|
||||
Reference in New Issue
Block a user