<% for field in all_fields -%> <% input_html = input_for field -%> <% if input_html -%> <%= input_html %> <% end -%> <% end -%>