Issue with using the rater for 2 different sizes on same page
Reported by Will Bunker | 2009-02-07 11:51:25 UTC
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 2009-03-05 18:52:56 UTC
- Assigned user set to Edgar Suarez
Could you please explain a bit more this issue?
-

Edgar Suarez 2009-03-05 19:18:11 UTC
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 2009-03-10 20:41:01 UTC
- 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