anyone? im still stumped on this one.
- j
On Jan 11, 2:00 pm, "Justin Williams"
<carpea...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I allow users to dynamically add and remove phone numbers with Ajax.
> They can then mark the primary number by clicking on a star which
> triggers an Ajax method to update the primary number.
>
> That method calls an RJS template that I need to modify the newly
> selected star as primary by changing its image to be star.gif & making
> the other images become star_off.gif.
>
> I am able to get the star image updating working partially, but I am
> not sure how to pass the index parameter to my RJS call so that
> everything will stay numbered correctly in my array.
>
> I am also not sure how to go about converting all non-primary images
> (including the previous primary) to be star_off while leaving the new
> primary as star_on.
>
> Relevant code below. Help is appreciated. Thanks!
>
> _star.rhtml
>
> <%= link_to_remote "#{star_image(phone, index)}", :url =>
{:controller
> => ''contacts'', :action
=>''mark_as_primary_phone'', :id => phone, :index
> => index} %>
>
> mark_as_primary.rjs
>
> page.replace ''phone_off'', :partial =>
"/shared/star", :locals => {
> :phone => @phone}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---