Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Issue with using the rater for 2 different sizes on same page

#1

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)

Reported by Will Bunker · February 7th, 2009 @ 11:51 AM

State: invalid
Milestone: none
Assigned to: Edgar Suarez Edgar Suarez

Activity

  1. Edgar Suarez
    Edgar Suarez
    • Assigned user set to Edgar Suarez

    Could you please explain a bit more this issue?

    March 5th, 2009 @ 06:52 PM

  2. Edgar Suarez
    Edgar Suarez

    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' %>
    

    March 5th, 2009 @ 07:18 PM

  3. Edgar Suarez
    Edgar Suarez
    • State changed from new to invalid

    March 10th, 2009 @ 08:41 PM

  4. Edgar Suarez
    Edgar Suarez

    No problem, I know it is not well documented.

    March 10th, 2009 @ 10:27 PM

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.