Problem with if and else code ... in ruby

Do not process variables and conditions ...

def index
end 

def search    
  count = 1
  while count < 3
    if count == 1
      @movie = "not found" if @code1 == nil || @code1 == ""
      if @movie == ""
      end
    end
    if count == 2
      @movie = "not found" if @code1 == nil || @code1 == ""
      if @movie == ""
        if @code1.include? "movshare"
        end
        if @code1.include? "novamove"
        end
      end 
    end
    count++
  end
end
end

what is the problem in this code? I get an error: syntax error, unexpected keyword_end

0
source share
2 answers

you have another unnecessary " end". There are 9 opening offers, including def, while and if10 closingend

+2
source

You confuse the interpreter with yours count++. ++does not exist in Ruby. You need to use count += 1. The interpreter probably assumes that this expression includes addition and expects another operand, but instead findsend

+2
source

All Articles