Posts Tagged ‘Ruby on Rails’

My Rails production setup

Posted in Coding on February 4th, 2009 by erik – 3 Comments

I’ve recently moved one of the products I’m maintaining to a new server, because it wasn’t performing as well as it was supposed to. In the process I’ve spent some time tweaking the server and simplifying the setup, and the following is an overview over some of the tools I’ve found most useful.
read more »

Site moved

Posted in Other on December 21st, 2008 by erik – Be the first to comment

I’m almost done moving my sites from Site5 to Dreamhost, since I like their way of offering subversion better, and there was a few extra features that I thought was cool, such as webdav, which I now use to sync OmniFocus between devices, and Passenger to easily run Ruby on Rails applications.

In the process, I’ve also decided to switch to Wordpress, since it has all the blog-related stuff I need, and not the extra weight of a lot of features I rarely use. Hopefully it will be easier to maintain sites for a few of my friends as well. I found upgrading a multi-site Drupal installation a tedious process. Dreamhost has a neat one-click managed install of Wordpress, where they automatically maintain and upgrade your Wordpress installation for you, if you can live without the ability to install custom plugins and themes. I’ve done a custom install, ’cause I wanted some plugins for Flickr integration, but it will make offering my friends and family a basic Wordpress installation as simple as clicking a button.

Moving day is usually also a good time to clean out your closet, and there are a couple of things that I’ve let go when moving my site. First of all, I’ve shut down the photo galleries, since I hadn’t put anything in them for years, and I felt they were not relevant to what I do now. These days I use Flickr to expose photos to the world, and Facebook for friends. I’ve also not transferred a lot of posts from 2007 and earlier, and I’ve unfortunately not yet found a way to migrate comments from the old posts.

DRY(er) Ruby on Rails view templates

Posted in Coding on May 13th, 2008 by erik – Be the first to comment

Something I keep coming across when working with Ruby on Rails view templates, is wrapping blocks of content in common DIV tags with certain properties, so I can easily style the application with CSS.

For example, a page can have multiple content boxes, and possibly a sidebar with a number of info boxes. What I used to do, was something like this:

<div id="sidebar">
  <div class="infobox">
    Here is some help
  </div>
</div>
<div class="content_box">
	<%= render :partial => "table", :locals => {:people => @people} %>
</div>

Instead, by looking at the implementaton of the content_tag_for ActionView helper, I was able to find a way to do this:

<% sidebar do %>
  <% infobox do %>
    Here is some help
  <% end %>
<% end %>
<% content_box do %>
  <%= render :partial => "table", :locals => {:people => @people} %>
<% end %>

read more »