Skip to content

Instantly share code, notes, and snippets.

@kethlinmil
Created March 7, 2017 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kethlinmil/056eea8d51967a738b91205594ff02f1 to your computer and use it in GitHub Desktop.
Save kethlinmil/056eea8d51967a738b91205594ff02f1 to your computer and use it in GitHub Desktop.
<div>
<% editable_attributes.each do |attribute| -%>
<dl class="row">
<dt class="col-sm-3"><%= attribute.human_name.titleize %>:</dt>
<dd class="col-sm-9"><%= "<%= @#{singular_name}.#{attribute.name} %%>" %></dd>
</dl>
<% end -%>
</div>
<p>
<%= "<%= link_to 'Edit', edit_#{singular_name}_path(@#{singular_name}), class: 'btn btn-sm btn-outline-info' %%>" %>
<%= "<%= link_to 'Destroy', #{singular_name}_path(@#{singular_name}), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-sm btn-outline-danger' %%>" %>
</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment