lundi 30 mai 2016

Correct use if != nil || != "" ROR

Redirect to city_path if @city.name not equal nil and ""

If @city.name equal "" also redirect to city_path. How to fix it?

if (@city.name != nil || @city.name != "")
      redirect_to city_path
      else
      render 'index'
    end

Aucun commentaire:

Enregistrer un commentaire