title: Rails ignores if and else statement
body: <p><strong>First thing, sorry for my bad english.</strong></p>
  
  <p>I have a condition that put a string in a variable in my view.</p>
  
  <p>My controller  </p>
  
  <pre><code>    def  index
      @hosts= Host.all
  
      @hosts.each do |host|
        if host.ativo?
          @status = "Sim"
        else
          @status = "Não"
        end
  
        if Time.zone.now &gt; host.validade
          flash[:info] = "Você tem hosts expirados !"
          @alerta = "Expirado !"
        else
          @alerta = "Válido !"
        end
       end
      end
  </code></pre>
  
  <p>My view </p>
  
  <pre><code>&lt;tbody&gt;
      &lt;% @hosts.each do |host| %&gt; 
  
        &lt;tr&gt;
          &lt;td&gt;&lt;%= link_to host.id, host_path(host),class: 'btn btn-default btn-xs'%&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= host.mac %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= host.nome %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= host.descricao %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= @status %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= host.validade.strftime("%d/%m/%Y %H:%M")%&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= @alerta %&gt;&lt;/td&gt;
          &lt;td&gt;
            &lt;%= link_to t('.edit', :default =&gt; t("helpers.links.edit")),
                        edit_host_path(host), :class =&gt; 'btn btn-default btn-xs' %&gt;
            &lt;%= link_to t('.destroy', :default =&gt; t("helpers.links.destroy")),
                        host_path(host),
                        :method =&gt; :delete,
                        :data =&gt; { :confirm =&gt; t('.confirm', :default =&gt; t("helpers.links.confirm", :default =&gt; 'Are you sure?')) },
                        :class =&gt; 'btn btn-xs btn-danger' %&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;% end %&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>But in my @alerta varibale i only get the string "Expirado" and in @status i only get "Sim" even if the @host.ativo? return false and Time.zone.now its &lt; than host.validade</p>
  
  <p>But if i put the same logic that is in controller in my view it works pretty well, i dont understand why</p>