errors.add(" ") not shows error message

Hi ALL...
I want to show error message when entered authority is invalid.
I implemented below in my controller

if params[:user_info][:login].empty?
  @user = UserInfo.find_by_login('admin')
  @company.authority_id =
  authority = UserInfo.find_by_login(params[:user_info][:login])
  if authority.nil?
    @approval = true
    @company.check_authority(@approval)#this method will be called since
authority is invalid
     @company.authority_id =

in my modal i have below function
def check_authority(authority)
  puts authority
  if authority == true
    puts "true"
    puts "false"
  puts "check"
  errors.add(:authority_id,"*please enter valid authority name") if
authority == true

In this above function it prints the value correctly...
But it dosenot show the error message...
What is the reason...
Any guess or suggestion....

This is probably a dumb question, but are you calling
error_messages_for in your view? The code you've shown appears to be

--Matt Jones