aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators
diff options
context:
space:
mode:
authorGiovanni Cappellotto <potomak84@gmail.com>2014-05-01 17:21:16 +0200
committerGiovanni Cappellotto <potomak84@gmail.com>2014-05-01 17:21:16 +0200
commitbed8882372b59a4ff1e4932f82fd4d5331cd05da (patch)
treee92da10c46824e0b9c41caac1c25798062c1959e /railties/lib/rails/generators
parentca20037899e55ddf734b727454a3180bebf82212 (diff)
downloadrails-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.
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r--railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb5
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 -%>