Commit 000c0324 authored by Nihad Abbasov's avatar Nihad Abbasov

display recent snippets at top

parent 5e584ee6
......@@ -22,6 +22,8 @@ class Snippet < ActiveRecord::Base
:presence => true,
:length => { :within => 0..10000 }
scope :fresh, order("created_at DESC")
def self.content_types
[
".rb", ".py", ".pl", ".scala", ".c", ".cpp", ".java",
......
......@@ -8,7 +8,7 @@
%th Title
%th File name
%th
= render @snippets
= render @snippets.fresh
:javascript
$('.delete-snippet').live('ajax:success', function() {
$(this).closest('tr').fadeOut(); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment