Nevermind, I found the problem. I was supposed to remove the @ because 
it's iterating from a loop:

<% @users.each do |user| %>

<%
    if user.first_name.nil? or user.last_name.nil?
      user_link = link_to 'User Details', user, 
:class=>'first_and_last_name'
    else
      user_link = link_to user.first_name + ' ' + user.last_name, user, 
:class=>'first_and_last_name'
    end
%>

  <% user_name = user.first_name.to_s + ' ' + user.last_name.to_s %>

  <div class="div_user">
    <span class="span_name"><%= link_to user_name, edit_user_path(user) 
%></span>
    <span class="span_title"><%= user.title %></span>
    <span class="span_email"><%= user.email %></span>

    <% if user.role == 'admin' %>
      <span class="span_role"><%= user.role %></span>
    <% end %>

    <% if can? :update, user %>
    <span class="span_user_controls">
      <%= link_to 'Edit', edit_user_path(user) %>
      <%= link_to 'Destroy', user, :confirm => 'Are you sure?', :method 
=> :delete %>
    </span>
    <% end %>
  </div>
<% end %>
</div>

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to