From 5257da7bb543e2b5a51da72a3e4bb77bf96eaefc Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 5 Nov 2021 16:47:38 +0100 Subject: [PATCH] Replace CSS references with inline basics (#43597) We no longer add a scaffold.css, so we shouldn't depend on it. --- .../erb/scaffold/templates/_form.html.erb.tt | 16 ++++++++-------- .../erb/scaffold/templates/index.html.erb.tt | 2 +- .../erb/scaffold/templates/partial.html.erb.tt | 2 +- .../erb/scaffold/templates/show.html.erb.tt | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt b/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt index e8e6561eff..a367393ad2 100644 --- a/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +++ b/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt @@ -1,6 +1,6 @@ <%%= form_with(model: <%= model_resource_name %>) do |form| %> <%% if <%= singular_table_name %>.errors.any? %> -
+

<%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:

    @@ -12,26 +12,26 @@ <%% end %> <% attributes.each do |attribute| -%> -
    +
    <% if attribute.password_digest? -%> - <%%= form.label :password %> + <%%= form.label :password, style: "display: block" %> <%%= form.password_field :password %>
    -
    - <%%= form.label :password_confirmation %> +
    + <%%= form.label :password_confirmation, style: "display: block" %> <%%= form.password_field :password_confirmation %> <% elsif attribute.attachments? -%> - <%%= form.label :<%= attribute.column_name %> %> + <%%= form.label :<%= attribute.column_name %>, style: "display: block" %> <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true %> <% else -%> - <%%= form.label :<%= attribute.column_name %> %> + <%%= form.label :<%= attribute.column_name %>, style: "display: block" %> <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %> %> <% end -%>
    <% end -%> -
    +
    <%%= form.submit %>
    <%% end %> diff --git a/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt b/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt index 67d07b4642..d8f9375c3b 100644 --- a/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +++ b/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt @@ -1,4 +1,4 @@ -

    <%%= notice %>

    +

    <%%= notice %>

    <%= human_name.pluralize %>

    diff --git a/railties/lib/rails/generators/erb/scaffold/templates/partial.html.erb.tt b/railties/lib/rails/generators/erb/scaffold/templates/partial.html.erb.tt index 229341562f..41b9180dfe 100644 --- a/railties/lib/rails/generators/erb/scaffold/templates/partial.html.erb.tt +++ b/railties/lib/rails/generators/erb/scaffold/templates/partial.html.erb.tt @@ -1,4 +1,4 @@ -
    +
    <% attributes.reject(&:password_digest?).each do |attribute| -%>

    <%= attribute.human_name %>: diff --git a/railties/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt b/railties/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt index 920d186981..9cf956f010 100644 --- a/railties/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +++ b/railties/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt @@ -1,4 +1,4 @@ -

    <%%= notice %>

    +

    <%%= notice %>

    <%%= render @<%= singular_table_name %> %>