hi everyone, i need to print error message if ID is greater than 1 and log user in if username is correct and display error message if the username is wrong.
the code print error message if id is greater than 1 and it authenticates user if correct username is entered but does no display error message is wrong username is entered rather, it dispalys empty page. any help

if id > '1'
puts 'your id is greater than 1'
# working
elsif username == 'mutago'
puts 'login' 
#working

else 
puts "wrong username"
#here is the problem not working rather dispalys empty page
end

Your probably mean to do something along the lines of if id > 1 instead of if id > '1' .
Notice the lack of single quotes in the first example.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.