开发者

ajaxful rating in rails 3?

I cant seem to get ajaxful rating to work in rails 3. Everything installed correctly but I dont know what the problem is. I installed it from https://github.com/mrbrdo/ajaxful_rating_jquery/ which the author says supports rails 3, but I continue to get the following error:

uninitialized constant AjaxfulRating::StarsBuilder::MissingRateRoute

but this is what my routes look like for what i want ratings for

resources :dishes, :shallow => true, :member => {:rate => :post} do
   resources :photos
   resources :comments, :only => [:开发者_运维百科create, :destroy]
end

if anyone has any other recommendations for another gem or plugin that does the same thing please post.


This is the gem that worked for me with rails 3.0.7 (from the original author of ajaxful_rating):

gem 'ajaxful_rating', :git => 'git://github.com/edgarjs/ajaxful-rating.git', :branch => "rails3"

Edit:

Your syntax doesn't actually create a users/rate route (run rake routes at the command line from your app to see a list of all routes). The following syntax is what you want:

resources :dishes, :shallow => true do
  member do
    post :rate
  end

  resources :photos
  resources :comments, :only => [:create, :destroy]
end


If you want to give a rating capability to your rails application in Rails 3.1 or higher, you can use the letsrate gem. You can check out from github repository.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜