Skip to content

Commit

Permalink
Show abusers
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed Oct 30, 2011
1 parent 5ed359e commit 2c28058
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/helpers/admin_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module AdminHelper

def abusers
file = Rails.root.join("tmp", "abusers.txt")
if File.exists?(file)
content_tag(:ul) do
safe_join File.readlines(file).map do |l|
content_tag(:li, l)
end
end
else
content_tag(:p, "aucun")
end
end

end
2 changes: 2 additions & 0 deletions app/views/admin/_box.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#admin_box.box
%h1
= link_to "Admin", '/admin'
%h2 Abusers
= abusers

0 comments on commit 2c28058

Please sign in to comment.