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

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 7, '12 at 3:17p
activeJan 7, '12 at 5:26p
posts2
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Erwin: 2 posts

People

Translate

site design / logo © 2022 Grokbase