Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved destroy modal into partial

  • Loading branch information...
commit 7e0fa464a345c11a0721d47fe549b54c201684c6 1 parent 64510df
@nmanzi authored
Showing with 15 additions and 14 deletions.
  1. +14 −0 app/views/links/_destroy.html.erb
  2. +1 −14 app/views/links/index.html.erb
View
14 app/views/links/_destroy.html.erb
@@ -0,0 +1,14 @@
+<a href="#" data-controls-modal="modal-<%= link.id %>" data-keyboard="true" class="label important">Destroy</a>
+<div id="modal-<%= link.id %>" class="modal hide fade">
+ <div class="modal-header">
+ <a href="#" class="close">&times;</a>
+ <h3>Are you sure?</h3>
+ </div>
+ <div class="modal-body">
+ <p>Really destroy subdomain <strong><%= "#{link.subdomain}.#{APP_CONFIG['parent_domain']}" %></strong>?</p>
+ </div>
+ <div class="modal-footer">
+ <%= link_to 'Destroy', link, method: :delete, :class => "btn danger" %>
+ <a href="#" class="btn secondary" data-controls-modal="modal-<%= link.id %>">Cancel</a>
+ </div>
+</div>
View
15 app/views/links/index.html.erb
@@ -18,20 +18,7 @@
<td><%= link.visits %></td>
<td>
<%= link_to 'Edit', edit_link_path(link), :class => "label" %>
- <a href="#" data-controls-modal="modal-<%= link.id %>" data-keyboard="true" class="label important">Destroy</a>
- <div id="modal-<%= link.id %>" class="modal hide fade">
- <div class="modal-header">
- <a href="#" class="close">&times;</a>
- <h3>Are you sure?</h3>
- </div>
- <div class="modal-body">
- <p>Really destroy subdomain <strong><%= "#{link.subdomain}.#{APP_CONFIG['parent_domain']}" %></strong>?</p>
- </div>
- <div class="modal-footer">
- <%= link_to 'Destroy', link, method: :delete, :class => "btn danger" %>
- <a href="#" class="btn secondary" data-controls-modal="modal-<%= link.id %>">Cancel</a>
- </div>
- </div>
+ <%= render :partial => 'destroy', :locals => { :link => link } %>
</td>
<% end %>
</tr>
Please sign in to comment.
Something went wrong with that request. Please try again.