For a little side project I am currently evaluating different ways of GUI programming using Ruby.
Monkeybars is one of the most interesting candidates.
There is a really good article
about it, if you want to learn more.
Version 1.0.4 has a little, but annoying bug: If you generate a new application skeleton it won’t compile/run:
manifest.rb:32:in `require': no such file to load -- monkeybars (LoadError)
from manifest.rb:32
from manifest.rb:21:in `require'
from main.rb:21
To fix it, you got to change line 21 of manifest.rb:
A little gotcha with custom setters for datetime attributes is, that when setting an attribute
through ‘write_attribute’ it is not converted to UTC (or whatever else your default time zone is).
This problem can easily be reproduced:
./script/generate model Thing a:datetime b:datetime
My model:
My tests:
The second assertion will fail. Is this intended or a bug?
Quick fix:
I included jQuery by installing the jRails plugin, which
seems nice because you can continue using rails’ ajax helpers. But when I tried to implement
a more special functionality by using the $.ajax function it proved impossible to set the
Accept header for my request. Neither using the dataType option nor by setting it directly
in a beforeSend function. The Accept header always read:
I was about to uninstall and hate jQuery for the rest of my life.
By coincidence I took a look at jrails.js which is a part of the jRails plugin:
WTF? Is that documented anywhere?
This hard coded shit stuff breaks rails’ respond_to functionality, doesn’t it?t
To be fair, it works if you use extensions to determine what datatype you expect. (Like /things/1.js)
But I don’t do that when I build a custom ajax request where I can set the Accept header directly.
Update:
Some research on the topic “accept header vs. extension” showed that in terms of cross browser
compatibility I should favor the extension approach. And I’m not surprised it’s
Microsoft’sfault :-)