Topic: is there a better way of doing this?

  <% if params[:user] %>
    <div class="list"><%= link_to "", "?user=#{params[:user]}&view=list" %></div>
    <div class="square"><%= link_to "", "?user=#{params[:user]}&view=grid" %></div>
    <div class="map"><%= link_to "", events_path(:user => params[:user]) %></div>
  <% else %>
    <div class="list"><%= link_to "", "?view=list" %></div>
    <div class="square"><%= link_to "", "?view=grid" %></div>
    <div class="map"><%= link_to "", events_path %></div>
  <% end %>

Re: is there a better way of doing this?

You can remove the redundant code by going this route (ternary statement):

<div class="list"><%= link_to "", "?view=list#{(u = params[:user]) ? "&user=#{u}" : ""}" %></div>

Re: is there a better way of doing this?

thanks for the tip