From c50f3da4be52b4275906b48ab02fb10ed6c41310 Mon Sep 17 00:00:00 2001 From: evazion Date: Fri, 10 Jan 2020 19:14:11 -0600 Subject: [PATCH] Fix #4179: Checkboxes remaining checked after submit on Add Commentary. Change add commentary to use edit_form_for, which adds autocomplete="off" to disable autofill in Firefox. --- app/views/artist_commentaries/_form.html.erb | 82 ++++---------------- app/views/posts/show.html.erb | 2 +- 2 files changed, 15 insertions(+), 69 deletions(-) diff --git a/app/views/artist_commentaries/_form.html.erb b/app/views/artist_commentaries/_form.html.erb index 249962a9e..d5481f471 100644 --- a/app/views/artist_commentaries/_form.html.erb +++ b/app/views/artist_commentaries/_form.html.erb @@ -10,90 +10,36 @@ -<%= form_tag(create_or_update_artist_commentaries_path(:format => :js), :remote => true, :id => "edit-commentary", :class => "simple_form", :method => :put) do %> - <%= hidden_field :artist_commentary, :post_id, :value => post.id %> +<%= 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 } %> -
- - <%= text_field :artist_commentary, :original_title, :value => post.artist_commentary.try(:original_title) %> -
+ <%= f.input :original_title, as: :string, input_html: { value: artist_commentary.try(:original_title) } %> + <%= f.input :original_description, input_html: { size: "40x6", value: artist_commentary.try(:original_description) } %> -
- - <%= text_area :artist_commentary, :original_description, :size => "40x6", :value => post.artist_commentary.try(:original_description) %> -
- -
- - <%= text_field :artist_commentary, :translated_title, :value => post.artist_commentary.try(:translated_title) %> -
- -
- - <%= text_area :artist_commentary, :translated_description, :size => "40x6", :value => post.artist_commentary.try(:translated_description) %> -
+ <%= f.input :translated_title, as: :string, input_html: { value: artist_commentary.try(:translated_title) } %> + <%= f.input :translated_description, input_html: { size: "40x6", value: artist_commentary.try(:translated_description) } %> <% if post.has_tag?("commentary") %> -
- -
+ <%= f.input :remove_commentary_tag, as: :boolean %> <% else %> -
- -
+ <%= f.input :add_commentary_tag, as: :boolean %> <% end %> <% if post.has_tag?("commentary_request") %> -
- -
+ <%= f.input :remove_commentary_request_tag, as: :boolean %> <% else %> -
- -
+ <%= f.input :add_commentary_request_tag, as: :boolean %> <% end %> <% if post.has_tag?("check_commentary") %> -
- -
+ <%= f.input :remove_commentary_check_tag, as: :boolean %> <% else %> -
- -
+ <%= f.input :add_commentary_check_tag, as: :boolean %> <% end %> <% if post.has_tag?("partial_commentary") %> -
- -
+ <%= f.input :remove_partial_commentary_tag, as: :boolean %> <% else %> -
- -
+ <%= f.input :add_partial_commentary_tag, as: :boolean %> <% end %> <% end %> diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index 084298b7b..84673c171 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -141,7 +141,7 @@