1
下面是我的應用程序 -爲什麼戒指會給我錯誤的迴應?
(ns mfaiz.routes
(:use [net.cgrand.moustache :only [app]]
[net.cgrand.enlive-html :only [deftemplate content]]
[ring.util.response :only [response]]))
(deftemplate reg "mfaiz/templates/reg.html" [])
(def my-app (app
["hi"] "Hello World!"
["reg"] (-> ((-> "reg" symbol resolve)) response constantly)
[&] "Nothing was found"))
我遇到的錯誤與這條路線 -
["reg"] (-> ((-> "reg" symbol resolve)) response constantly)
如果我直接評價上面的路線,它工作正常,並返回HTML文件 -
((-> "reg" symbol resolve))
如果我也改變路線直接調用模板功能,那麼它也可以工作 -
["reg"] (-> (reg) response constantly)
任何想法出了什麼問題?
嘗試使用'( - >「mfaiz.routes/reg」符號解析)' – Ankur
@Ankur謝謝,這就像一個魅力! Ankur爲什麼需要在ns中存在符號時指定ns。此外,評估是成功的,沒有納稅資格,爲什麼呢? – murtaza52
你也可以將它作爲答案發布,我會標記它。 – murtaza52