Permalink
Browse files

Add destroy link

  • Loading branch information...
1 parent ad88bc3 commit 81b2b1687af876563f1ae473ae90e57f20d4030a @garethrees committed Jul 30, 2012
Showing with 17 additions and 0 deletions.
  1. +8 −0 app/assets/stylesheets/jists.css.scss
  2. +5 −0 app/controllers/jists_controller.rb
  3. +4 −0 app/views/jists/show.html.erb
@@ -74,6 +74,14 @@
}
}
}
+
+ .actions {
+ .destroy {
+ float: right;
+ font-size: 13px;
+ }
+ }
+
}
.jists.index {
@@ -43,5 +43,10 @@ def update
def destroy
@jist = Jist.find(params[:id])
+ @jist.destroy
+
+ respond_to do |format|
+ format.html { redirect_to(root_path, :notice => 'Jist was successfully deleted.') }
+ end
end
end
@@ -19,6 +19,10 @@
<% end %>
</section>
+ <section class="actions">
+ <%= link_to "Delete this Jist", jist_path(@jist), method: :delete, confirm: 'Are you sure? This Jist will be permanently deleted.', class: 'destroy' %>
+ </section>
+
</article>
<% content_for :secondary do -%>

0 comments on commit 81b2b16

Please sign in to comment.