Permalink
Browse files

added list of all items

  • Loading branch information...
1 parent 59f57f8 commit e3c1c596faaccb230fdba65b5338d9c93982c6be @benatkin committed Mar 12, 2010
Showing with 11 additions and 0 deletions.
  1. +5 −0 views/all.haml
  2. +1 −0 views/show.haml
  3. +5 −0 weaky.rb
View
@@ -0,0 +1,5 @@
+%p
+- @items.each do |item|
+ %p
+ %a{ :href => item.url }= item.name
+
View
@@ -1,5 +1,6 @@
#admin
%p
%a{ :href => @item.edit_url } edit
+ %a{ :href => '/items/all' } all
#item
= @item.body_html
View
@@ -65,6 +65,11 @@ class Weaky < Sinatra::Base
sass :stylesheet
end
+ get '/items/all' do
+ @items = Item.all
+ haml :all
+ end
+
get '/new/:name' do
@item = Item.new(:name => params[:name])
@action = '/save'

0 comments on commit e3c1c59

Please sign in to comment.