I am trying to use the in_place_editor and update multiple ids on the
page based on the edits.
Here''s the example:
Want to let users edit the zip code using <%= in_place_editor_field
:customer, :zip, :script => true %> and when they complete the edit,
want to update one other id on the page that shows the customer city. I
have defined a method in the controller as -
def set_customer_zip
@customer = Customer.find(params[:id])
@customer.zip = params[:value]
@customer.city = "New City"
end
Here''s what I have tried so far
1. In set_customer_zip
render :text => @customer.zip
render :update do |page|
page.replace_html ''customer_city'', @customer.city
end
Error: Two renders not allowed.
2. In set_customer_zip
render :update do |page|
page.replace_html ''customer_zip'', @customer.zip
page.replace_html ''customer_city'', @customer.city
end
Problem: No syntax errors. Customer city gets updated and so does
customer zip, but customer zip no longer has the in-place edit
functionality
Any help is greatly appreciated. Thanks in advance.
Ray
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---