Permalink
Browse files

new ubuntu setup

  • Loading branch information...
1 parent 36901b1 commit 6dac3cdead8d6f764ec9639866a7b615c4c04e7b ujk committed Oct 21, 2012
Showing with 39 additions and 1 deletion.
  1. +3 −1 hello.rb
  2. +36 −0 hello.rb~
View
@@ -1,4 +1,6 @@
require "sinatra"
+require "haml"
+require "haml-coderay"
get "/" do
@@ -32,4 +34,4 @@
end
end
-
+
View
@@ -0,0 +1,36 @@
+require "sinatra"
+require "haml"
+
+
+get "/" do
+ haml :index
+end
+
+get "/kitap/:n" do |number|
+ if File.exist?("./views/kitap_#{number}.haml")
+ haml :"kitap_#{number}"
+ else
+ haml :"405"
+ end
+end
+
+get "/k_search" do
+ @kelime = params[:search_str]
+ @start = params[:start]
+ @end = params[:end]
+ haml :k_search
+end
+
+get "/email/:name" do |isim|
+ haml :email, :locals => {:isim => isim}
+end
+
+get "/:sayfa" do |s|
+ if File.exist?("./views/#{s}.haml")
+ haml :"#{s}"
+ else
+ haml :"404"
+ end
+end
+
+

0 comments on commit 6dac3cd

Please sign in to comment.