Imagine the following situation:

I have a user model and a user\_group model, so:

```
Class User <  ActiveRecord::Base
  belongs_to :user_group
end

Class UserGroup < ActiveRecord::Base
  has_many :users
end

```

Now, let say some of the user does not have group. Which mean, when I call:

```
<% @u.each do |item| %>
              <tr>
                <td><%= item.id %></td>
                <td><%= item.username %></td>
                <td><%= item.name %></td>
                <td><%= item.user_group.name %></td>
              </tr>
              <% end %>

```

It will throw nil. Is there any way nil will be displayed as empty string (somewhat like LEFT JOIN, or DataMapper include\_related in CodeIgniter) instead of showing error page? 

Right now I am using 

```
<%= item.user_group.name unless item.user_group.nil? %>

```

to check before calling, but doing that for all view file is somewhat not a good approach.

Thanks in advance!