You can also choose to hide or show this entire category. When hiding, any existing answers you have to fields in this category will also be hidden, but not deleted. You can recover them by un-hiding this category at any time.
<%= form_for(category, method: :put) do |f| %> <%= f.hidden_field :hidden, value: !category.hidden? %> <%= f.submit (category.hidden? ? 'Show' : 'Hide') + ' this category', class: 'btn white black-text' %> <% end %>This is a VERY dangerous action! This will delete this category, every field in this category, and every answer you've written to any of those fields! This CANNOT be undone, so please make sure you have backed up any answers you will lose by deleting the field they're answering.
<% if category.persisted? && current_user.can_delete?(category) %> <%= link_to category, class: 'btn red black-text', method: :delete, data: { confirm: "Are you sure? This will delete this entire category, all of its fields, and any answer you've written to any of those fields!" } do %> Delete this category <% end %> <% end %>