[SOLVED]  should use .htl() and not .replaceWith()

On Jan 7, 4:17 pm, Erwin <yves_duf...@mac.com> wrote:
> VIEWS
>
> contacts/new.html.haml
> ...
> .contact_details
>    = render :partial => "contacts/details"
>
> contacts/_details.html.haml
> ..
>  %b= regions_in_area(@area)   # from contacts_helper.rb  sending back
> a string according to @area
>
> upon a drop down change , an Ajax request is send to
> contacts#change_area action  with a new area found :
>   def change_area
>     @area = Area.find(params[:id])
>     render "contacts/change_area.js"
>   end
>
> and the change_area.js is very simple , replacing the .contact_details
> $('.contact_details').replaceWith( '<%=
> escape_javascript(render :partial => "contacts/details") %>');
>
> this runs very well on the first drop down change, but on the second
> change, even if the @area is changed and also the string from the
> helper...  the new string is NOT displayed ...
>
> what's wrong in my code ?
>
> thanks for your feedback

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to