From 0e7277a046a99ef28cbf3794110d956e55f0bf58 Mon Sep 17 00:00:00 2001 From: John Ma Date: Thu, 15 Nov 2018 12:56:00 -0500 Subject: [PATCH] Modify UI for "accept terms" checkbox (#321) * * --- app/views/users/new.html.erb | 5 ++++- config/environments/development.rb | 5 +++++ config/environments/production.rb | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index ae03bb29..6209b528 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -61,7 +61,10 @@ <% if Rails.configuration.terms %>
- <%= f.check_box :accepted_terms, class: "form-control #{form_is_invalid?(@user, :accepted_terms)}", placeholder: t("signup.password_confirm") %> + <%= f.label :accepted_terms, t("terms.accept", href: link_to(t("terms.title"), terms_path, target: "_blank", class: "ml-1 text-blue")).html_safe, class: "ml-1" %>
<%= @user.errors.full_messages_for(:accepted_terms).first %>
diff --git a/config/environments/development.rb b/config/environments/development.rb index cdd5c078..0eeb0fb0 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -28,6 +28,11 @@ Rails.application.configure do config.cache_store = :null_store end + # Don't wrap form components in field_with_error divs + ActionView::Base.field_error_proc = proc do |html_tag| + html_tag.html_safe + end + # Tell Action Mailer to use smtp server, if configured config.action_mailer.delivery_method = ENV['SMTP_SERVER'].present? ? :smtp : :sendmail diff --git a/config/environments/production.rb b/config/environments/production.rb index fd1d8ae5..f63fd8df 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -51,6 +51,11 @@ Rails.application.configure do # Prepend all log lines with the following tags. config.log_tags = [:request_id] + # Don't wrap form components in field_with_error divs + ActionView::Base.field_error_proc = proc do |html_tag| + html_tag.html_safe + end + # Use a different cache store in production. # config.cache_store = :mem_cache_store