lib/pow-index.rb in pow-index-0.0.3 vs lib/pow-index.rb in pow-index-0.0.4
- old
+ new
@@ -23,22 +23,26 @@
get '/linktable' do
@pows = Dir[POW_PATH + "/*"].map { |link| File.basename(link) }
haml :linktable
end
+ get '/assets/:filename' do
+ File.readlines("#{File.dirname(__FILE__)}/../assets/#{params[:filename]}")
+ end
+
end
end
__END__
@@ index
%html
%head
%title pow index
- %link{:rel => 'stylesheet', :href => 'http://twitter.github.com/bootstrap/assets/css/bootstrap-1.2.0.min.css'}
- %script{:type => 'text/javascript', :src => 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js'}
+ %link{:rel => 'stylesheet', :href => '/assets/bootstrap-1.2.0.min.css'}
+ %script{:type => 'text/javascript', :src => 'assets/jquery.min.js'}
= haml :js
%body
.container
%h1 pow index
%table.zebra-striped#linktable
@@ -52,10 +56,10 @@
@@ linktable
%tbody
- @pows.each do |pow|
%tr
%td
- %a{:href => "http://#{pow}.dev" :target => "_blank"}
+ %a{:href => "http://#{pow}.dev", :target => "_blank"}
= pow
@@ js
:javascript
function loadtable(){