Category Archives: Ruby

Tips when writing an API in Ruby on Rails

Posted in Blog, Ruby | Leave a comment

Deploying Rails 3 apps to a subdirectory with the asset pipeline

When precompiling assets on deployment Rails has no idea where your application is hosted. If you are running your application on a subdirectory all of your image-url directives in your CSS for asset images will construct incorrect URLs. The solution … Continue reading

Posted in Blog, Ruby | Leave a comment

Adding files to config.assets.precompile in Rails 3.1+

I came across a problem that stumped me for quite a while today, so thought it best I write it down. In Rails 3.1+ with the asset pipeline enabled any files that are not referenced by a manifest file (e.g. … Continue reading

Posted in Blog, Noteworthy, Ruby | 7 Comments

Solving Latin1 and UTF8 errors for good in Ruby

Update: I haven’t tested it fully, but @eevee has a shorter suggestion that seems to work: Tell the mysql driver that you’re getting BINARY back, then use .force_encoding(“UTF-8”)? In a Rails application you can do this by setting encoding: binary … Continue reading

Posted in Blog, Noteworthy, Ruby | 6 Comments

Using Compass with Rails 3.1 final and no hacks

The web is full of complicated instructions about getting the Compass CSS framework to work with Rails 3.1 & the asset pipeline when actually you don’t need to do anything any more. All you need to do, is add Compass … Continue reading

Posted in Blog, Ruby | 5 Comments