Topic: Whats wrong with this if statement, as it's not displaying what I want

Im trying to complete:

if the URL is empty and is equal to http://www. tell the user that the URL is not present, if it is and not equal to just http://www. then display the URL.  Whats wrong with this, as it displays  http://www. as well as a link.  I just want it to display the full link or the text saying the URL is not present.

<% if project.url.nil? && project.url == "http://www." %>
        No URL present, please <%= link_to('add a URL', :controller => 'project', :action => 'edit', :id => project.id) %><br />
        <% else %>
        <%= auto_link(project.url) %> <img class="externalLink" src="/images/admin01/icon_externallink.png" title="External Link" alt="Icon external link" width="10" height="10" /><br />
        <% end %>

Re: Whats wrong with this if statement, as it's not displaying what I want

The following can't ever be true:
project.url.nil? && project.url == "http://www."
"http://www." is not nil so your comparison will always be false.
Do you want?:
project.url.nil? || project.url == "http://www."