jump to navigation

Sinatra utf-8 Content-Type before filter April 22, 2009

Posted by John Dewey in Code, Example, Sinatra.
trackback

I wanted to learn Sinatra, so I started converting my personal Rails site over to Sinatra. I scrape my Twitterholic rating, and redisplay it on my site. I need the css and html to have a Content-Type of utf-8.

I came up with the following before filter. There is probably a better way to do this, I just wanted my controllers to be less “wet”.

I also use the following to render all css.

Advertisements

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: