ajax - Rails Gem: Ajaxful_rating route problem -
i'm trying ajaxful_rating work rails installation.
i have running find until user clicks on star rate.
when click star, browser url points http://localhost:3000/entries/1/rate?dimension=design&show_user_rating=false&small=true&stars=4
, error: no route matches "/entries/1/rate"
but routes say:
resources :entries collection ... end member post 'rate' put 'submit' end
is there i'm missing? js not included? have included jquery right now.
edit
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 }
this server says when click on rating.
your application sending get
request (the parameters passed in url), declared post
route.
changing post 'rate'
get 'rate'
allow request go through.
the other possibility application generating get
on client side when should generating post
. i'd need @ view code diagnose one.
Comments
Post a Comment