The Blog!
One of the most helpful and simple-to-use Rails plugins is simple_localization. It makes the job of localizing a Rails application a lot easier and straight forward; it implements localization through a set of features. One of the most commonly used features is localized ActiveRecord error messages. Its use is for localizing the standard error messages generated upon ActiveRecord validations ("can't be blank", "is too short", ..etc).
Working on a Rails project, after localizing the whole application, everything was working just fine in the development environment. However, when trying it in production environment, the locaized-error-messages feature didn't seem to work properly. Error messages for some (not all) of the models were not translated. To my surprise, those models were exactly those being observed by declared observers.
Now, what seems to be the problem? The problem is that the implementation of localized-error-messages feature is just as simple as follows; it just overrides ActiveRecord::Errors.default_error_messages with the translated version.
One of the common bugs of IE is the box model bug which affects the box model of any HTML block-level element when the page is in quirks mode. In brief, IE includes the padding when calculating the width of the block. Personally, I found this very logical and I don't like to consider it a bug, but since it violates the W3C standards, it is a bug.
One simple approach to avoid this bug is to avoid specifying both width and padding or border for an element. How?
Sometimes when you are dealing with some of your models, you ask yourself has this model changed? if so then, which attributes? and what were their values before that change?
When should you care about these questions?
Suppose you have a model doing an expensive operation before saving. This operation is useful only if one specific attribute changed, so doing it on every save, neglecting which attributes have changed, will degrade performance significantly.
So what can you do?
The News
eSpace's Social Network Community
28DeceSpace is now taking an active part in the social networking craze that has accompanied the new Internet generation. The birth of Web 2.0 has given way to a more interactive web that allows all users to participate and share. People from all over the globe are finally finding ways to express ideas, share opinions, debate and discuss.
eSpace at RubyConf2008 Now Online!
03DecA video of eSpace's Yasser Wahba's talk at the 2008 RubyConf is now online and available right here.
eSpace at RubyConf2008 (Update)
10NoveSpace's Yasser Wahba was a speaker at the 8th annual RubyConf that took place from the 6th to the 8th of November in Orlando, Florida.

