I have this list of users that I want to include in a group. I choose
these users from a larger group - all the employees for a company , for
example. I have both lists displayed on the page, the thing is that when
I choose a user to include in my list I want to have that user shown in
the list (update that list) but also have that user taken out of the
other list. So basically I need to update two divs. I am using a
form_remote_tag to :update the one div, but how do I update the second.
Is there a way to update two divs as a result of an action? thanks,
I have this list of users that I want to include in a group. I choose
these users from a larger group - all the employees for a company , for
example. I have both lists displayed on the page, the thing is that when
I choose a user to include in my list I want to have that user shown in
the list (update that list) but also have that user taken out of the
other list. So basically I need to update two divs. I am using a
form_remote_tag to :update the one div, but how do I update the second.
Is there a way to update two divs as a result of an action? thanks,
-S
Hi
You can update two divs using :update =>“div1,div2” in form_remote_tag
and also by using
render :update do |page|
page.replace_html ‘div1’, :partial => ‘file1’
page.replace_html ‘div2’, :partial => ‘file2’
I have this list of users that I want to include in a group. I choose
these users from a larger group - all the employees for a company , for
example. I have both lists displayed on the page, the thing is that when
I choose a user to include in my list I want to have that user shown in
the list (update that list) but also have that user taken out of the
other list. So basically I need to update two divs. I am using a
form_remote_tag to :update the one div, but how do I update the second.
Is there a way to update two divs as a result of an action? thanks,
-S
Hi
You can update two divs using :update =>“div1,div2” in form_remote_tag
and also by using
render :update do |page|
page.replace_html ‘div1’, :partial => ‘file1’
page.replace_html ‘div2’, :partial => ‘file2’
in the controller
This doesn’t work at all, at least not for me. I have a form_remote_tag
with :update => ‘div1, div2’ and then in my controller I have the above
code. If I leave off the :update, my button for the form act as if they
haven’t been hit and with the update I get the same behavior. Is there
something that I’m missing? Thanks,
This doesn’t work at all, at least not for me. I have a form_remote_tag
with :update => ‘div1, div2’ and then in my controller I have the above
code. If I leave off the :update, my button for the form act as if they
haven’t been hit and with the update I get the same behavior. Is there
something that I’m missing? Thanks,
-S
I take that back, it is working - kinda, but I think my issue is in my
code seperate then from your code Abhi. I removed the :update in the
form tags and that seemed to help a lot. Thanks,