0

Do not treat to the 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

2

2 Answers 2

2

you have one more unnecessary 'end'. There are 9 opening clauses including def, while and if and 10 closing end

Sign up to request clarification or add additional context in comments.

Comments

2

You are confusing the interpreter with your count++. ++ does not exist in Ruby. You need to use count += 1. The interpreter is probably assuming that is an expression involving addition, and expecting another operand but instead finding end

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.