Re: How to check the existence of div?

On 20 May 2008, at 11:53, Nathan E. wrote:

Two ways…simple way is simply write the function in pure javascript
and then invoke it in the rjs…i.e “someFunction”,

but what if I REALLY want to be able to dynamically evaluate ruby code
as part of the template…I have used a plugin called MinusMOR

Neat. Not surprising to see yet another excellent thing from Dan
Webb!. With the latest stuff I’ve been I doing I’ve taking to just the
writing the javascript statically.
Actions render :json (or just html fragments) and the ajax callbacks
on the other side put things together. With a good dose of prototype
javascript isn’t that bad. And I can write better unit tests for my
static javascript than I can for generated javacscript.


My ramblings:"##{params[:id]}parents").any(elem){|elem|.replace_html
‘blah’} will return a collection of dom elements that match a css
selector, so the first part of that line is selecting the element with

The second half of the line (*.any(){}) translates to a javascript
iterator on the returned collection. I have not tested that
particular code but I’ve used rjs like it to conditionally update the
browser in the past.

On May 20, 7:01 am, Frederick C. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs