diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2017-11-26 19:45:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-26 19:45:29 +0100 |
commit | b1f140ef2e5af605ea12d8ee1c932eaf728a398d (patch) | |
tree | 95d06393b221dcbaa2ffc63806e474912d70c828 /railties/lib/rails | |
parent | d7ab5710916f8ee58a970312e9bc9276022fe3a6 (diff) | |
parent | fbb8b373472e40aadd4c604d8574c0a82074a84a (diff) | |
download | rails-b1f140ef2e5af605ea12d8ee1c932eaf728a398d.tar.gz rails-b1f140ef2e5af605ea12d8ee1c932eaf728a398d.tar.bz2 rails-b1f140ef2e5af605ea12d8ee1c932eaf728a398d.zip |
Merge pull request #31229 from y-yagi/remove_field_ids_from_scaffold_form
Remove field ids from scaffold form
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt | 6 | ||||
-rw-r--r-- | railties/lib/rails/generators/named_base.rb | 4 |
2 files changed, 3 insertions, 7 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 0eb9d82bbb..518cb1121e 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 @@ -15,15 +15,15 @@ <div class="field"> <% if attribute.password_digest? -%> <%%= form.label :password %> - <%%= form.password_field :password, id: :<%= field_id(:password) %> %> + <%%= form.password_field :password %> </div> <div class="field"> <%%= form.label :password_confirmation %> - <%%= form.password_field :password_confirmation, id: :<%= field_id(:password_confirmation) %> %> + <%%= form.password_field :password_confirmation %> <% else -%> <%%= form.label :<%= attribute.column_name %> %> - <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, id: :<%= field_id(attribute.column_name) %> %> + <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %> %> <% end -%> </div> diff --git a/railties/lib/rails/generators/named_base.rb b/railties/lib/rails/generators/named_base.rb index 99165168fd..98fcc95964 100644 --- a/railties/lib/rails/generators/named_base.rb +++ b/railties/lib/rails/generators/named_base.rb @@ -114,10 +114,6 @@ module Rails "new_#{singular_route_name}_url" end - def field_id(attribute_name) - [singular_table_name, attribute_name].join("_") - end - def singular_table_name # :doc: @singular_table_name ||= (pluralize_table_names? ? table_name.singularize : table_name) end |