Browse files

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.
  • Loading branch information...
1 parent ca20037 commit bed8882372b59a4ff1e4932f82fd4d5331cd05da @potomak potomak committed May 1, 2014
Showing with 0 additions and 5 deletions.
  1. +0 −5 railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb
View
5 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 -%>

0 comments on commit bed8882

Please sign in to comment.