Found out how to solve it: I moved the "update" and "partial" parameters from the ratings partial to the Ratings > Create controller... Here is what it looks like now:
Ratings Controller: I changed the render options
render :update do |page|
page.replace_html 'star-ratings-block', :partial => 'ratings/rating', :locals => { :asset => @course }
end
Partial "ratings/_rating.html.erb":
<div id="rating_div">
<%= number_with_precision(asset.avg_rating, :precision => 1) %>/5 Stars<br>
<ul>
<li>
<%= link_to_remote "1", {:url => { :controller => "ratings", :action => :create,
:rating => {:rateable_type => asset.class.to_s.downcase, :rateable_id => asset.id, :rating => 1}}},
:method => :post, :class => 'one-star', :name => '1 star out of 5' %>
</li>
...
</ul>
</div>
The partial is included in the main view like that:
<div 'star-ratings-block'>
<%= render "ratings/rating", :locals => { :asset => yourvariablehere } %>
</div>
It now works as desired!
alex
2010-10-15 01:19:53