[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Wee 0.8.0

Michael Neumann

4/4/2005 5:05:00 PM

Hi,

Wee 0.8.0 is out. Have fun!

Major changes are:

* Ajax support (live updates). See examples/ajax/ajax.rb.

* FastCGI adaptor (working but not fully tested)

* Fixed bug in callback processing.

For example, you can update a field with Ajax like this:

def render
r.div.id('field')
r.anchor.onclick_update('field') { update_field }.with('Click here')
end

def update_field
send_render_response {
r.text "Live update works!"
}
end

More? http://rubyforge.org/pr...

Regards,

Michael


6 Answers

Its Me

4/5/2005 3:50:00 PM

0

"Michael Neumann" <mneumann@ntecs.de> wrote in message

> * Ajax support (live updates). See examples/ajax/ajax.rb.

That is great news. Is there some configuration needed? When I tried the
ajax.rb I got the 1st page fine, but when I click on the "Helloooo" I got:
undefined method `+' for
nil:NilClassC:/ruby/lib/ruby/gems/1.8/gems/wee-0.8.0/examples/ajax/ajax.rb:2
3:in `update'
C:/ruby/lib/ruby/gems/1.8/gems/wee-0.8.0/examples/ajax/ajax.rb:22:in
`with_renderer_for'
c:/ruby/lib/ruby/gems/1.8/gems/wee-0.8.0/lib/wee/core/presenter.rb:139:in
`send_render_response'

> * FastCGI adaptor (working but not fully tested)

Great news too!

> For example, you can update a field with Ajax like this:
>
> def render
> r.div.id('field')
> r.anchor.onclick_update('field') { update_field }.with('Click here')
> end

Does this block-form of callback assume continuations? Is the other form:
r.anchor.onclick_update('field', :update_field }.with('Click here')
the non-callback version?

Thanks!



Michael Neumann

4/5/2005 5:15:00 PM

0

Am Dienstag 05 April 2005 17:54 schrieb itsme213:
> "Michael Neumann" <mneumann@ntecs.de> wrote in message
>
> > * Ajax support (live updates). See examples/ajax/ajax.rb.
>
> That is great news. Is there some configuration needed? When I tried the
> ajax.rb I got the 1st page fine, but when I click on the "Helloooo" I got:
> undefined method `+' for
> nil:NilClassC:/ruby/lib/ruby/gems/1.8/gems/wee-0.8.0/examples/ajax/ajax.rb:
>2 3:in `update'
> C:/ruby/lib/ruby/gems/1.8/gems/wee-0.8.0/examples/ajax/ajax.rb:22:in
> `with_renderer_for'
> c:/ruby/lib/ruby/gems/1.8/gems/wee-0.8.0/lib/wee/core/presenter.rb:139:in
> `send_render_response'

Oops, sorry. @live_updates is not initialize... use this patch:

--- ajax.rb (revision 602)
+++ ajax.rb (working copy)
@@ -20,7 +20,7 @@

def update
send_render_response {
- r.text "Live-updates works! This is no. #{ @live_updates += 1}"
+ r.text "Live-updates works! This is no. #{ @live_updates =
(@live_updates || 0) + 1 }"
}
end
end

> > * FastCGI adaptor (working but not fully tested)
>
> Great news too!
>
> > For example, you can update a field with Ajax like this:
> >
> > def render
> > r.div.id('field')
> > r.anchor.onclick_update('field') { update_field }.with('Click here')
> > end
>
> Does this block-form of callback assume continuations? Is the other form:
> r.anchor.onclick_update('field', :update_field }.with('Click here')
> the non-callback version?


No, both do not involve continuations! The non-block form (:update_field) is
only for people that want to marshal the component state... blocks can't be
marshalled whereas symbols can.

Regards,

Michael


Its Me

4/6/2005 2:45:00 AM

0


"Michael Neumann" <mneumann@ntecs.de> wrote in message

> Wee 0.8.0 is out. Have fun!

Any idea what might be causing my wee rdoc to not appear (alongside the rdoc
for other gems in gem_server) in this version? It was there for previous wee
gems. It could be I did something foolish (I did remove some wee directories
I found in my regular non-gem ruby lib directories prior to gem-installing
0.8.).

Thanks.


Its Me

4/6/2005 3:36:00 AM

0


"Michael Neumann" <mneumann@ntecs.de> wrote in message
> Wee 0.8.0 is out. Have fun!

How does one update multiple DOM nodes in a single liveUpdate?

Thanks.




Michael Neumann

4/6/2005 11:43:00 AM

0

Am Mittwoch 06 April 2005 04:49 schrieb itsme213:
> "Michael Neumann" <mneumann@ntecs.de> wrote in message
>
> > Wee 0.8.0 is out. Have fun!
>
> Any idea what might be causing my wee rdoc to not appear (alongside the
> rdoc for other gems in gem_server) in this version? It was there for
> previous wee gems. It could be I did something foolish (I did remove some
> wee directories I found in my regular non-gem ruby lib directories prior to
> gem-installing 0.8.).

Simply because I did not generate the rdoc files for 0.8.0 (I had some not yet
ready-to-commit files in my tree that I did not want to show up). You can do
this yourself if you like with "rake rdoc".

Regards,

Michael


Michael Neumann

4/6/2005 11:46:00 AM

0

Am Mittwoch 06 April 2005 05:39 schrieb itsme213:
> "Michael Neumann" <mneumann@ntecs.de> wrote in message
>
> > Wee 0.8.0 is out. Have fun!
>
> How does one update multiple DOM nodes in a single liveUpdate?

Good question. No problem from the Wee side, but I am not good enough in
Javascript to implement this. What I thought is, that Wee would generate a
document like:

<root>
<div id="id1"> .... content .... </div>
<div id="id2"> ..... content .... </div>
</root>

This would update the DOM nodes id1 and id2 with the content.

Anyone willing to hack this in javascript?

Regards,

Michael