If you have tried to develop some rails application on Rails + Ruby 1.9.1 and MySQL database and you are storing non-English characters in your database probably you had a lot of pain with errors about incompatible charsets. This is a known problem and there is even a bug in Rails’ lighthouse for it. There is even a hack which is going around the issue. The solution is not perfect, but it works in most of the cases.
My journey into the ruby 1.9 land continues with some nice observations, tricks and tips.
Probably you remember that some time ago I decided to switch my blog from blogger to a custom made blogging engine written my me. It was a simple sinatra app, which was parsing a bunch of markdown files, which were the posts and rendering the blog.
I decided to use ruby 1.9.1 for my next project. One of the reasons I decided so is because ruby 1.9 is definitely faster than 1.8 and also it has a superior encoding support for the strings. Not to mention that living on the edge is a thrill :-)
I know that some people could start a flame war about what I will discussing right now, so let me first introduce you into the context of the problem.
This is a task that was given to a group of children for admission in kindergarten for gifted children in Nagoya, Japan. 74% of the children solved it. A hint: they were able to count up to 10.
I encountered some very strange erb behaviors when the you comments in the templates. For example:
<% if true %> Hi from Rails! <% end # hi from rails %>
These days I am working on a large change in our corporate website. It includes a lot of functional changes as well as a lot of little text tweaks here and there. Our process for making these changes is that the marketing people go through the whole site and generate a large document, which includes all the modifications that should be made. After that the developers go through the large doc and start making the changes. The problem is that this process is very inefficient. This is because of the following reasons:
On the 27th of July there will be a small rails conference in Sofia. http://techcamp.eu/2009/06/21/rails-конференция-27-06-2009/ has more info for the event.
I will be speaking on the conference about stubbing and mocking with mocha. I have made an example project on which I will explain my ideas. You can find the latest source here.
We will see there :-).