-
Notifications
You must be signed in to change notification settings - Fork 127
Rating possible but no page update #41
Comments
Using firebug I was able to get a more detailed error on the issue: |
This is because the code for the ajax callback does not work with nested routes. My example routes.rb: map.resources :users do |user| I believe the problem lies in lines 47-48 of stars_builder.rb: rateable_name = ActionController::RecordIdentifier.singular_class_name(rateable) This assumes that your route is not nested. So url = "rate_image_path" instead of url = "rate_user_portfolio_image_path" (which is what it should be). I patched this by hardcoding the url, but I know this is not the best solution. Any thoughts on how to fix this to work with nested routes? |
Same problem here. Any updates on this? Or a good workaround? |
Thanks @crowdvn...it worked perfectly!! |
Hi,
I have implemented the ajaxful-rating and I am able to rate my model. BUT I don’t get any page update. in order to see the applied rating I have to reload the page.
Admittedly, I am using the ajaxful-rating gem under rather complicated circumstances:
I am able to display the global rating and under that the rating of that particular user using the following code in my view:
I do get the hover effect when mousing over the stars due to including <%= ajaxful_rating_style %> in my layout file.
When clicking a star the rating is kind of indicated by keeping number of rated stars in the hover state (red/orange). The rating does take place due to my controller functions:
The rating is applied and the average is calculated which can be seen upon reloading the page. But the ajax part of updating the star rating upon click does not happen. Instead I do get the following error in the logs:
My routes for this rating looks like this:
I am so close, any help on this would be greatly appreciated.
Cheers J.
The text was updated successfully, but these errors were encountered: