and following in view
<div id="results">
<li>one</li>
</div>
<%= link_to_remote "add", :url => {:action => :add} %>
and i always get count = 1
I'm not sure I understand exactly what it is you're trying to accomplish,
but in general.... I would recomment keeping track of 'count' in your
controller method; storing / retrieving it there and making it available to
your view via an instance variable. You're not dealing with a static page
of which you have no knowledge. Everything that's on the page is put there
by your app during the session. No?
In an action in the controller, responding to the xhr request when you do
render :update to |page|
I just did a page.inspect in the log and found @content_for_layout - I think you would have to do something like page.session.content_for_layout - the log is pretty ugly - you can check.
But, if you have @content_for_layout you could count the occurance of
in that and unless you have
in your layout you will have the number of li’s.
However, this sounds very convoluted - you would probably be better of just adding the milliseconds id for the li.