[ANN] Wee 0.8.0

  • Thread starter Michael Neumann
  • Start date
M

Michael Neumann

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/projects/wee

Regards,

Michael
 
M

Michael Neumann

Am Dienstag 05 April 2005 17:54 schrieb itsme213:
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
Great news too!


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
 
M

Michael Neumann

Am Mittwoch 06 April 2005 04:49 schrieb itsme213:
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
 
M

Michael Neumann

Am Mittwoch 06 April 2005 05:39 schrieb itsme213:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top