1
<%= (@post.category ? @post.category.name : '') + ' ' + link_to(@post.title, post_path(@post)) %>
@post.category can be nil, ...
@post.category can be nil, ...