diff options
author | Giovanni Cappellotto <potomak84@gmail.com> | 2014-05-01 17:21:16 +0200 |
---|---|---|
committer | Giovanni Cappellotto <potomak84@gmail.com> | 2014-05-01 17:21:16 +0200 |
commit | bed8882372b59a4ff1e4932f82fd4d5331cd05da (patch) | |
tree | e92da10c46824e0b9c41caac1c25798062c1959e | |
parent | ca20037899e55ddf734b727454a3180bebf82212 (diff) | |
download | rails-bed8882372b59a4ff1e4932f82fd4d5331cd05da.tar.gz rails-bed8882372b59a4ff1e4932f82fd4d5331cd05da.tar.bz2 rails-bed8882372b59a4ff1e4932f82fd4d5331cd05da.zip |
Avoid unnecessary conditional block
GeneratedAttribute#column_name checks already for reference? on the
attribute returning the right name to use as symbol for label and field.
-rw-r--r-- | railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb b/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb index 10f80abb15..da99e74435 100644 --- a/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb +++ b/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb @@ -21,13 +21,8 @@ <%%= f.label :password_confirmation %><br> <%%= f.password_field :password_confirmation %> <% else -%> - <%- if attribute.reference? -%> <%%= f.label :<%= attribute.column_name %> %><br> <%%= f.<%= attribute.field_type %> :<%= attribute.column_name %> %> - <%- else -%> - <%%= f.label :<%= attribute.name %> %><br> - <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %> - <%- end -%> <% end -%> </div> <% end -%> |