0
我想讓ajaxful_rating與我的rails安裝一起工作。Rails Gem:Ajaxful_rating路由問題
我已經找到了所有東西,直到用戶點擊一個星標來評分。
當我點擊一個明星,瀏覽器URL指向http://localhost:3000/entries/1/rate?dimension=design&show_user_rating=false&small=true&stars=4
和我得到這個錯誤:No route matches "/entries/1/rate"
但我的路說:
resources :entries do
collection do
...
end
member do
post 'rate'
put 'submit'
end
有我丟失的東西?有些js不包括在內?我現在包括的所有內容都是jquery。
編輯
try {
Element.update("ajaxful_rating_design_no-small_entry_1", "<ul class=\"ajaxful-rating\"><li class=\"show-value\" style=\"width: 60.0%\">Global rating average: 3.0 out of 5</li><li><a href=\"/entries/1/rate?dimension=design&show_user_rating=false&small=false&stars=1\" class=\"stars-1\" data-method=\"post\" data-remote=\"true\" rel=\"nofollow\" title=\"Rate 1 out of 5\">1</a></li><li><a href=\"/entries/1/rate?dimension=design&show_user_rating=false&small=false&stars=2\" class=\"stars-2\" data-method=\"post\" data-remote=\"true\" rel=\"nofollow\" title=\"Rate 2 out of 5\">2</a></li><li><a href=\"/entries/1/rate?dimension=design&show_user_rating=false&small=false&stars=3\" class=\"stars-3\" data-method=\"post\" data-remote=\"true\" rel=\"nofollow\" title=\"Rate 3 out of 5\">3</a></li><li><a href=\"/entries/1/rate?dimension=design&show_user_rating=false&small=false&stars=4\" class=\"stars-4\" data-method=\"post\" data-remote=\"true\" rel=\"nofollow\" title=\"Rate 4 out of 5\">4</a></li><li><a href=\"/entries/1/rate?dimension=design&show_user_rating=false&small=false&stars=5\" class=\"stars-5\" data-method=\"post\" data-remote=\"true\" rel=\"nofollow\" title=\"Rate 5 out of 5\">5</a></li></ul>");
new Effect.Highlight("ajaxful_rating_design_no-small_entry_1",{});
} catch (e) { alert('RJS error:\n\n' + e.toString()); alert('Element.update(\"ajaxful_rating_design_no-small_entry_1\", \"<ul class=\\\"ajaxful-rating\\\"><li class=\\\"show-value\\\" style=\\\"width: 60.0%\\\">Global rating average: 3.0 out of 5</li><li><a href=\\\"/entries/1/rate?dimension=design&show_user_rating=false&small=false&stars=1\\\" class=\\\"stars-1\\\" data-method=\\\"post\\\" data-remote=\\\"true\\\" rel=\\\"nofollow\\\" title=\\\"Rate 1 out of 5\\\">1</a></li><li><a href=\\\"/entries/1/rate?dimension=design&show_user_rating=false&small=false&stars=2\\\" class=\\\"stars-2\\\" data-method=\\\"post\\\" data-remote=\\\"true\\\" rel=\\\"nofollow\\\" title=\\\"Rate 2 out of 5\\\">2</a></li><li><a href=\\\"/entries/1/rate?dimension=design&show_user_rating=false&small=false&stars=3\\\" class=\\\"stars-3\\\" data-method=\\\"post\\\" data-remote=\\\"true\\\" rel=\\\"nofollow\\\" title=\\\"Rate 3 out of 5\\\">3</a></li><li><a href=\\\"/entries/1/rate?dimension=design&show_user_rating=false&small=false&stars=4\\\" class=\\\"stars-4\\\" data-method=\\\"post\\\" data-remote=\\\"true\\\" rel=\\\"nofollow\\\" title=\\\"Rate 4 out of 5\\\">4</a></li><li><a href=\\\"/entries/1/rate?dimension=design&show_user_rating=false&small=false&stars=5\\\" class=\\\"stars-5\\\" data-method=\\\"post\\\" data-remote=\\\"true\\\" rel=\\\"nofollow\\\" title=\\\"Rate 5 out of 5\\\">5</a></li></ul>\");\nnew Effect.Highlight(\"ajaxful_rating_design_no-small_entry_1\",{});'); throw e }
這是當我點擊了評級什麼我的服務器說。
將'post'改爲'get'後,我在瀏覽器中看到了一個js ajax調用,現在有什麼問題? –
發佈服務器日誌 – Luke
日誌爲空,但這是我點擊某個星號時瀏覽器所說的內容。 –