Fix #5208: The posts version of create or update artist commentary endpoint does not work without the post ID parameter being passed in the body

Fix /posts/:post_id/artist_commentary/create_or_update not working
without passing `artist_commentary[post_id]` in the form body.
This commit is contained in:
evazion
2022-08-25 21:50:33 -05:00
parent 91b3a4c37a
commit 18c949ff34
3 changed files with 16 additions and 5 deletions

View File

@@ -10,9 +10,7 @@
</div>
</form>
<%= edit_form_for(artist_commentary, url: create_or_update_artist_commentaries_path(format: :js), remote: true, method: :put, html: { id: "edit-commentary" }) do |f| %>
<%= f.input :post_id, as: :hidden, input_html: { value: post.id } %>
<%= edit_form_for(artist_commentary, url: create_or_update_post_artist_commentary_path(post_id: post.id, format: :js), remote: true, method: :put, html: { id: "edit-commentary" }) do |f| %>
<%= f.input :original_title, as: :string, input_html: { value: artist_commentary.try(:original_title) } %>
<%= f.input :original_description, input_html: { value: artist_commentary.try(:original_description) } %>