how to create simple login form

i m new to ROR..........
i make a simple progm for login..........

Username and password.......

if(right)
{
login
}
else
{
error msg
}

can u help me in this..........
My form is

looks good to me. What's the problem?