Yet Another... wait. This is my first Wee Example. :-)

J

Joao Pedrosa

Hi,

While studying Wee for the last 5 days, I was joined by a friend
(Caio) and we created an example of Wee that has a mini-blog, a table
editor for the blog, a country/state/city table editor and an about
that shows the code behind the scenes in my preferred syntax colors.
:)

Besides an annoying bug which had an alternative approach, Wee and
WEBrick faired very well.

In case the example URL changes, I will update the URL in my blog:
http://sinsalabintrix.blogspot.com/2005/02/wee-web-framework-put-to-test.html

The Wee example URL:
http://201.9.180.14:81/app

I have thanked a lot of guys in the last few days, but I should have
mentioned the creator of WEBrick. Thank you, TAKAHASHI Masayoshi. You
know how important WEBrick has become to a lot of us. :)

Cheers,
Joao
 
M

Michael Neumann

Joao said:
Hi,

While studying Wee for the last 5 days, I was joined by a friend
(Caio) and we created an example of Wee that has a mini-blog, a table
editor for the blog, a country/state/city table editor and an about
that shows the code behind the scenes in my preferred syntax colors.
:)

Thanks for the nice examples! For some reason the DBButtons do not work
using Konqueror as browser. But in Firefox they work.
Besides an annoying bug which had an alternative approach, Wee and
WEBrick faired very well.

But no bug in Wee or WEBrick, right? What was it exactly? Maybe we can
put a FAQ together, so that other people can avoid those bugs too.

One source of error is:

for i in [...]
end

vs.

[...].each do |i|
end

You should use the second for (#each), if you use callbacks, as the
first one (for i in) does not create a new scope for variable "i".

Regards,

Michael
 
J

Joao Pedrosa

Hi,

Thanks for the nice examples! For some reason the DBButtons do not work
using Konqueror as browser. But in Firefox they work.

Thanks for the info.
Besides an annoying bug which had an alternative approach, Wee and
WEBrick faired very well.

But no bug in Wee or WEBrick, right? What was it exactly? Maybe we can
put a FAQ together, so that other people can avoid those bugs too.

One source of error is:

for i in [...]
end

vs.

[...].each do |i|
end

You should use the second for (#each), if you use callbacks, as the
first one (for i in) does not create a new scope for variable "i".

Nice guess!

That is the "bug" that had bitten me. I used callback in a loop and
was wondering why it wouldn't work. Later I was reading the code of
Wee and I remembered of the other option which did work. :)

BTW, it would be good to expose the head tag somewhere so we could add
tags to it, like the link_css. :) And add the <DOCTYPE> to the
beginning of the HTML. Anyway of doing this?

Cheers,
Joao
 
C

Caio Tiago Oliveira

Joao Pedrosa, 19/2/2005 10:53:
BTW, it would be good to expose the head tag somewhere so we could add
tags to it, like the link_css. :) And add the <DOCTYPE> to the
beginning of the HTML. Anyway of doing this?

;)

BTW: is impossible to make valid code without it.
The link tag shouldn't be used in the body, its place is the head.
Doctype is also a lot important.
 
M

Michael Neumann

Caio said:
Joao Pedrosa, 19/2/2005 10:53:



;)

BTW: is impossible to make valid code without it.
The link tag shouldn't be used in the body, its place is the head.
Doctype is also a lot important.

Could you send me a sample DOCTYPE?

Note that it's easy to do this yourself (nevertheless I'd like to add
this to Wee):

def render
r << "<!DOCTYPE...>"
r.html {
r.head {
...
}
r.body {
...
}
}
end

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top