<% # This 'unless' can be removed if :name is no longer assumed to be a default attribute. unless attributes.find {|attr| attr.name == 'name'} %>

Name: <%%= @content_block.name %>

<% end %> <%- for attribute in attributes -%> <%- case attribute.type when :attachment -%>

Attachment: <%%= link_to @content_block.attachment_file_path, @content_block.attachment_link %>

<%- when :category -%>

Category: <%%= @content_block.category_name %>

<%- else -%>

<%= attribute.name.titleize %>: <%%= @content_block.<%= attribute.name %> %>

<%- end -%> <% end %>