mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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.
This commit is contained in:
parent
ca20037899
commit
bed8882372
1 changed files with 0 additions and 5 deletions
|
@ -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 -%>
|
||||
|
|
Loading…
Reference in a new issue