The ActiveRecord::Base.attributes() method returns a hash of all the attributes. You can use that to loop over all attributes.
@work_profile.attributes.each do |attr_name, attr_value|
...
end
In a view, this would give:
<% @work_profile.attributes.each do |attr_name, attr_value| %>
<div class="work_profile_attribute">
<%= attr_name %>: <%= attr_value %>
</div>
<% end %>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…