Auto_link generating error (nil.gsub) in functional test

Hi everyone,

When running tests, I get this error for running auto_link on a set of
column data:

ActionView::TemplateError: You have a nil object when you didn’t expect
The error occured while evaluating nil.gsub
On line #28 of app/views/personnel/list.rhtml

25:   <tr valign="top" class="<%= alternate_rows %>">
26:   <% display_columns = ["username", "preferred_name", "email",

“title”] %>
27: <% display_columns.each do |column| %>

<%= auto_link(person.send(column)) %>
29: <% end %>
30: <%= link_to ‘Details’, :action => ‘show’, :id => person

Only one of the pieces of data ends up with a link (the email), so
this is probably bad design anyway. How can I handle auto-linking the
email address in this situation?



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs