                           (.-body js/document)))]
     (http-get "http://localhost:8090/bookmarks" onres)))
 
-(defroute bookmark-path "/addbookmark" []
-  (r/render [cb/page](.-body js/document)))
+(defroute bookmark-path "/bookmark" []
+  (r/render [page](.-body js/document)))
 
 (defroute "*" []
-  (js/alert "<h1>Not Found</h1>"))
+  (js/alert "<h1>Not Found Page</h1>"))
 
 
 (defn main

     [:div.col-sm-2 [:input.form-control {:id "sText" :type "text"
                                          :placeholder "search by title"}]]
     [:input {:type "button" :value "Search"
              :class "btn btn-primary" :on-click search}]]]
   [:table {:class "table table-striped table-bordered"}
    [:thead
     [:tr

        [:td (he/url-format (.-url bm) (.-title bm))]
        [:td (.-description bm)]])]]])

(defn row [label input]
  [:div.row
   [:div.col-md-2 [:label label]]
   [:div.col-md-5 input]])
(defn radio [label name value]
  [:div.radio
   [:label
    [:input {:field :radio :name name :value value}]
    label]])

(defn input [label type id]
  (row label [:input.form-control {:type type :id id}]))


(defn bookmark-template []
  [:div.form-group
   [:div (input "Title" "text" "title")]
   [:div  (input "URL" "text" "url")]
   [:div (input "Tags" "text" "tags")]
   [:div  (input "Description" "textarea" "desc")]])

(defn getinputvalue[id]
(.-value (.getElementById js/document id)))

(defn get-bookmark-formdata []
  { :title (getinputvalue "title")
    :url (getinputvalue "url")
    :description (getinputvalue "desc")})



(defn save [event]
  (let [onres (fn[data] (set! (.-location js/window) "http://localhost:8090"))]
    (http-post "http://localhost:8090/bookmark" 
               onres  (JSON/stringify (clj->js (get-bookmark-formdata))))))

(defn page [body]
  (fn []
    [:div
     [:div.padding]
     [:div.page-header [:h1 "Book Marks"]]
     [bookmark-template]
     [:input {:type "button" :value "Save"
              :class "btn btn-primary" :on-click save}]
     [:div.padding]
     [:div.page-footer [:h6 "Copyright ©2015 A TechnoIdentity Creations — All Rights Reserved."]]
     ]))

(defroute home-path "/" []
  (let [onres (fn [json]
