I am new at ruby on rails and I am trying to set up a simple log in for a part of the site. I have gotten the log in to work however when the user puts in a incorrect username, I want a message to say "Invalid log in. Try again." I can not figure this out any help would be greatly appreciated
HERE IS MY CODE IN MY CONTROLLER
class SimpleloginController < ApplicationController
def namein
end
def transmain
@familyname_out = params[:family_name_in] #textbox name from the input file
name_out = params[:family_name_in]
if found = Family.find_by_name(name_out)
redirect_to manin_manout_path, :notice => "Logged in successfully"
else
redirect_to simplelogin_namein_path, :notice => "Invalid login. Try again"
end
end
end