More than once writing view code for a Rails application ends up with a messy template file. The separation of structure and style doesn’t always work out as intended. Frameworks like Bootstrap force you to use nested structures and lots of class attributes. The view code ends up with a lot of duplication and is hard to read as a result. You’ll get away with that for a while, constantly fearing the next redesign…
Like any other build process, deploying Rails applications should be a quick and easy task. You should be able to deploy everything to your server with just one command. There are several tools available for this task. One of them is Capistrano, which is probably the oldest and by far the most popular deployment tool in the Rails community. Unfortunately the documentation is still not great and a lot of very handy features are unknown to many. Only digging through the API documentation and the source code reveals them.
When testing helper methods that use Rails’ output buffer (for example
concat) with RSpec, be sure to add this to your specs:
before (:each) do helper.output_buffer = "" end
Took me a while to figure this one out. Apparently RSpec doesn’t
initialize the output buffer and you end up with a
Yesterday I decided to give Phusion Passenger aka mod_rails a try and installed it. It was dead simple to set it up and to deploy rails applications with it. I’m now using it for several “small” applications, for which the whole overhead of setting up a cluster of mongrels and a proxy doesn’t seem to be adequate. I’ll give you a short summary on how to install mod_rails for apache2 on Debian Etch.
I try to keep up with Ruby and Ruby on Rails, even if I’m not working with one of them at the moment. These are the three feeds helping me to get the latest news:
PlanetRubyOnRails.com, not to be mixed up with PlanetRubyOnRails.org, is a simple feed aggregator with a set of quite informative blogs. Including the official Riding Rails Blog, Ruby Inside, and InfoQ. Unfortunately...