Hello ... I am using the acts_as_ratable plugin, but am trying to tweak it a bit ...
I have this code in my view: <%= render :partial => "ratings/rate", :locals => { :asset => current_user, :thing_id => @thing.id } %>
And in my Ratings controller I have: def rate return unless logged_in?
rateable = @rateable_class.find(params[:id]) thingID = thing_id
# Delete the old ratings for current user Rating.delete_all(["rateable_type = ? AND rateable_id = ? AND user_id = ? AND errand_id = ?", @rateable_class.base_class.to_s, params[:id], @current_user.id, thing_id]) rateable.add_rating Rating.new(:rating => params[:rating], :user_id => @current_user.id, :errand_id => thing_id)
render :update do |page| page.replace_html "star-ratings-block-#{rateable.id}", :partial => "rate", :locals => { :asset => rateable, : thing_id => thingID} page.visual_effect :highlight, "star-ratings-block- #{rateable.id}" end
end
in the RJS file I have: page.replace_html "star-ratings-block-#{current_user.id}", :partial => '/ratings/rate', :locals => { :asset => current_user, :thing_id => @thing.id }
When I click on a rating, which renders the partial I get this error:
NameError (undefined local variable or method `thing_id' for #<RatingsController:0xb7b40f48>):
Why isn't the local variable I am passing from the partial available to me in my controller?
Thanks for any insight!!!
LAB