diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 74127c8b5..3a92f76e6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -197,6 +197,11 @@ module ApplicationHelper simple_form_for(:search, method: method, url: url, defaults: defaults, html: html_options, &block) end + def edit_form_for(model, **options, &block) + options[:html] = { autocomplete: "off", **options[:html].to_h } + simple_form_for(model, **options, &block) + end + def table_for(*options, &block) table = TableBuilder.new(*options, &block) render "table_builder/table", table: table diff --git a/app/views/admin/users/edit.html.erb b/app/views/admin/users/edit.html.erb index caad5eef8..38a08c915 100644 --- a/app/views/admin/users/edit.html.erb +++ b/app/views/admin/users/edit.html.erb @@ -2,7 +2,7 @@
diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb index e64ee90f1..36ddea864 100644 --- a/app/views/comments/_form.html.erb +++ b/app/views/comments/_form.html.erb @@ -1,6 +1,6 @@ <%= error_messages_for :comment %> -<%= simple_form_for(comment, :html => {:style => ("display: none;" if local_assigns[:hidden]), :class => "edit_comment"}) do |f| %> +<%= edit_form_for(comment, html: { style: ("display: none;" if local_assigns[:hidden]), class: "edit_comment" }) do |f| %> <%= f.hidden_field :post_id %> <%= dtext_field "comment", "body", :classes => "autocomplete-mentions", :value => comment.body, :input_id => "comment_body_for_#{comment.id}", :preview_id => "dtext-preview-for-#{comment.id}" %> <%= f.button :submit, "Submit" %> diff --git a/app/views/dmails/_form.html.erb b/app/views/dmails/_form.html.erb index 527a10c26..f3efb498c 100644 --- a/app/views/dmails/_form.html.erb +++ b/app/views/dmails/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for(dmail) do |f| %> +<%= edit_form_for(dmail) do |f| %> <%= f.input :to_name, :label => "To", :input_html => { value: dmail.to.try(:name), data: { autocomplete: "user" } } %> <%= f.input :title, :as => :string %> <%= dtext_field "dmail", "body" %> diff --git a/app/views/favorite_group_orders/edit.html.erb b/app/views/favorite_group_orders/edit.html.erb index eaafa2042..d3a3099a2 100644 --- a/app/views/favorite_group_orders/edit.html.erb +++ b/app/views/favorite_group_orders/edit.html.erb @@ -13,7 +13,7 @@ <% end %> - <%= simple_form_for(@favorite_group, :format => :js, :html => {:id => "ordering-form"}) do |f| %> + <%= edit_form_for(@favorite_group, :format => :js, :html => {:id => "ordering-form"}) do |f| %> <%= submit_tag "Save" %> <% end %>
You must re-enter your password to view or change your API key.
- <%= simple_form_for CurrentUser.user, url: view_user_api_key_path(CurrentUser.user), method: :post do |f| %> + <%= edit_form_for CurrentUser.user, url: view_user_api_key_path(CurrentUser.user), method: :post do |f| %> <%= f.input :password, :as => :password, :input_html => {:autocomplete => "off"} %> <%= f.button :submit, "Submit" %> <% end %> diff --git a/app/views/maintenance/user/dmail_filters/edit.html.erb b/app/views/maintenance/user/dmail_filters/edit.html.erb index 1a0644c67..8a4149790 100644 --- a/app/views/maintenance/user/dmail_filters/edit.html.erb +++ b/app/views/maintenance/user/dmail_filters/edit.html.erb @@ -17,7 +17,7 @@Drag and drop the list below to determine ordering.
diff --git a/app/views/pools/edit.html.erb b/app/views/pools/edit.html.erb index e2a7f718b..053fa2e4c 100644 --- a/app/views/pools/edit.html.erb +++ b/app/views/pools/edit.html.erb @@ -1,6 +1,6 @@Before creating a pool, read the <%= link_to "pool guidelines", wiki_page_path(:id => "howto:pools") %>.
- <%= simple_form_for(@pool) do |f| %> + <%= edit_form_for(@pool) do |f| %> <%= f.input :name, :as => :string, :required => true %> <%= dtext_field "pool", "description" %> <%= f.input :post_ids_string, as: :text, label: "Posts" %> diff --git a/app/views/post_appeals/_new.html.erb b/app/views/post_appeals/_new.html.erb index b652c1d08..3bce7ef08 100644 --- a/app/views/post_appeals/_new.html.erb +++ b/app/views/post_appeals/_new.html.erb @@ -5,7 +5,7 @@ <%# XXX dtext_field expects there to be a `post_appeal` instance variable. %> <% @post_appeal = post_appeal %> - <%= simple_form_for(@post_appeal, format: :js, remote: true) do |f| %> + <%= edit_form_for(@post_appeal, format: :js, remote: true) do |f| %> <%= f.hidden_field :post_id %> <%= dtext_field "post_appeal", "reason", preview_id: "dtext-preview-for-post-appeal", type: "string" %> <%= dtext_preview_button "post_appeal", "reason", preview_id: "dtext-preview-for-post-appeal" %> diff --git a/app/views/post_disapprovals/_detailed_rejection_dialog.html.erb b/app/views/post_disapprovals/_detailed_rejection_dialog.html.erb index 4e1462359..3da4fb3a3 100644 --- a/app/views/post_disapprovals/_detailed_rejection_dialog.html.erb +++ b/app/views/post_disapprovals/_detailed_rejection_dialog.html.erb @@ -1,7 +1,7 @@ - <%= simple_form_for(post_replacement, url: post_replacements_path(post_id: post_replacement.post_id), method: :post) do |f| %> + <%= edit_form_for(post_replacement, url: post_replacements_path(post_id: post_replacement.post_id), method: :post) do |f| %> <%= f.input :replacement_file, label: "File", as: :file %> <%= f.input :replacement_url, label: "Replacement URL", hint: "The source URL to download the replacement from.", as: :string, input_html: { value: post_replacement.post.normalized_source } %> <%= f.input :final_source, label: "Final Source", hint: "If present, the source field will be changed to this after replacement.", as: :string, input_html: { value: post_replacement.post.source } %> diff --git a/app/views/posts/partials/show/_edit.html.erb b/app/views/posts/partials/show/_edit.html.erb index 65ebb9c7b..683124e7e 100644 --- a/app/views/posts/partials/show/_edit.html.erb +++ b/app/views/posts/partials/show/_edit.html.erb @@ -6,7 +6,7 @@ <%= render "sources/info" %> -<%= simple_form_for(post, html: { id: "form", autocomplete: "off" }) do |f| %> +<%= edit_form_for(post, html: { id: "form" }) do |f| %> <%= hidden_field_tag :tags_query, params[:q] %> <%= hidden_field_tag :pool_id, params[:pool_id] %> <%= hidden_field_tag :favgroup_id, params[:favgroup_id] %> diff --git a/app/views/saved_searches/_interface.html.erb b/app/views/saved_searches/_interface.html.erb index 3e1b6b3ed..30139adac 100644 --- a/app/views/saved_searches/_interface.html.erb +++ b/app/views/saved_searches/_interface.html.erb @@ -1,6 +1,6 @@