Michael Williams wrote:
I am not sure what your problem is. ï¿½Please provide more detail and
Basically I have two partials that render. One is the “Available
Items” and the other is “Selected Items”. If I select an “Available
Item” then it gets added to “Selected Items”. However, if I remove a
“Selected Item” I need it to go back to “Available Items”.
Yes, I get that. As I said in my first message, if you can do one, you
can do the other the same way – so what’s the problem?
are initially rendered from the VIEW code, both work just fine.
unordered list item to either column.
to write appropriate JS to the onclick attribute in the HTML tag? If
so, that’s incorrect. You just need to add behavior to the appropriate
DOM element, and that’s very easy to do.
Currently I’m actually using a
partial within a partial to manage each new item. It adds a
“link_to_remote” item for each newly added item.
Why two levels of partials? I don’t see how that’s necessary here.
My “issue” is that
“render :update” method in the controller so I have to call a partial
in order to insert the appropriate code.
As I keep saying on this list, learn the framework instead of kludging
your way around it.
I could very likely be
asking the wrong question(s)
It seems to me that you should be asking how to use render :update (or
The reason I need it to update immediately is because it is a multi-
user setup and if one user has selected an item, I need it to
immediately be “taken out” of circulation.
I understand. I’ve done things like that as well, though not with
In either case, I’d still
need dynamic code to, at the very least, move the items back and
I do not know if you really know what you mean when you say “dynamic
code”. Please explain how you understand that phrase; I think you may
be using it in an inaccurate sense.