Issue with using the rater for 2 different sizes on same page
Reported by Will Bunker | February 7th, 2009 @ 11:51 AM
When I have 2 different objects to rate and want to set different sizes the reverse_merge is preserving the setting of the first call:
I was able to remove by the following code, but you may have a more clever solution.
def ratings_for(rateable, *args)
#we must clear out the :class if present so that if more than one type of rater is on the page
#the first one won't control the settings
options[:html].delete(:class) if !options.nil? and options.has_key?(:html) and options[:html].has_key?(:class)
Comments and changes to this ticket
-
Edgar Suarez March 5th, 2009 @ 06:52 PM
- Assigned user set to Edgar Suarez
Could you please explain a bit more this issue?
-
Edgar Suarez March 5th, 2009 @ 07:18 PM
But it should be no problem since the options hash includes a separate key for the small size class.
So for example we could define two helpers with different sizes:
Big stars: <%= ratings_for @article, :class => 'big-size' %> Small stars: <%= ratings_for @article, :small_stars => true, :small_star_class => 'small-size' %>
-
Edgar Suarez March 10th, 2009 @ 08:41 PM
- State changed from new to invalid
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Rails plugin to generate a simple and nice rating system ajaxly.
http://github.com/edgarjs/ajaxful-rating