Archive for December, 2005

Rails: Escaping html entities

Thursday, December 22nd, 2005

Many times data entered on the screen by a user, or data fetched from the db, contains less than (<), greater than (>), ampersand (&) and quotes etc. These characters have special meaning in html. And if these are passed in the view as such, they may garble the browser display.

The h() method prevents these characters in strings from garbling the browser display. The h() method escapes them as html entities.

h() method in rails does the same thing as htmlentities() does in php.

Update [17th Jan 2006] I just learnt that long name of h() is html_escape()

Wordpress as CMS

Thursday, December 15th, 2005

I have been using wordpress for some time now, writing small modules and themes as well.
This blog also runs on wordpress.

Recently for a client, I wanted a content management system. I studied creation of pages at wordpress codex site and found it had everything that I needed.
Page creation, individual themes for pages, page list for navigation menu, nesting of pages, everything i needed for the client, so that the ultimate control over the content and style remains with the client.

I was so impressed that i decided to setup my company site also in wordpress. And while doing so, I thought it would be good to add blog as a feature of my company site.
The site is at http://vinsol.com .
By and large the structure is there, I need to add a lot of content though.

It is a site which is very proudly powered by WP.

Suzuki coffee

Wednesday, December 14th, 2005

I love Coffee, good Coffee that is, which sadly is not easily available in Delhi.
I tried Devans and Barista Home blend.
But my regular coffee is Lavazza which I buy from INA market or Modern Bazaar, Vasant Vihar.

I bought a new coffe, suzuki coffee from Modern Bazaar this time. I like it more than any other coffee I had for a long time. It was made from “Sumatra Mandheling” beans.

You can get more details at this site .

JLPT exam

Monday, December 5th, 2005

Took my JLPT exam yesterday. Thank God, it’s over.
Now i can do more programming, without feeling guilty about it. ( I should rather be studying Japanese uhh… uhhh.. can play with ruby on rails after the exam too…)

I plan to continue studying Japanese. And now with the exam out of the way, I hope to enjoy it more, since I would study it my way. Rather than focus on passing the exam.

Sometimes I let my short term priorities override my long term priorities. Or maybe it was just my insecurity that made me do so.