Hi,
I'm in the process of integrating the jQuery star rating plugin with Rails. I've written the Rails server-side code and have sorted the submission of a new rating, but at the moment I'm struggling to figure out how to display the average rating value as a static series of stars using the plugin. Displaying the rating itself is fine:
<p>
<b>Rating:</b>
<%= @place.rating_av %>
</p>
...but what is the best way of passing that value to the stars? Static stars are displayed using the following code (from the plugin site):
<input name="star3" type="radio" class="star" disabled="disabled"/>
<input name="star3" type="radio" class="star" disabled="disabled"/>
<input name="star3" type="radio" class="star" disabled="disabled" checked="checked"/>
<input name="star3" type="radio" class="star" disabled="disabled"/>
<input name="star3" type="radio" class="star" disabled="disabled"/>
This example displays 3 out of 5 stars. I don't need any ajax functionality here, just a simple static display. Should I think about a helper method (eg. if @place.rating_av == 3, output is as shown above)? Any help would be much appreciated!