# Error\_messages\_for doesn't generate output though the instance seems to contain error messages

**URL:** <https://www.ruby-forum.com/t/error-messages-for-doesnt-generate-output-though-the-instance-seems-to-contain-error-messages/127190>\
**Category:** Rails\
**Created:** [January 25, 2008, 11:53pm UTC](https://www.ruby-forum.com/t/error-messages-for-doesnt-generate-output-though-the-instance-seems-to-contain-error-messages/127190 "2008-01-25T23:53:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9a28c/32.png) [@skt](https://www.ruby-forum.com/u/skt)\
**Post date:** [January 25, 2008, 11:53pm UTC](https://www.ruby-forum.com/t/error-messages-for-doesnt-generate-output-though-the-instance-seems-to-contain-error-messages/127190/1 "2008-01-25T23:53:32Z")

</div>

Hello folks,

I am having problems with something rather simple. I have in my rhtml  
file the following code fragment -

```
  <%= error_messages_for 'loan' %>
    <% for e in @loan.errors
    logger.info("---> error = " + e.to_s)
  end%>

```

In development.log file I see the following show up

—\> error = loan\_type\_idsYou need to select at least one loan type  
—\> error = loan\_amountcan’t be blank

However I don’t see any html output from the call to  
error\_messages\_for in the page returned containing the error. Not sure  
why error\_messages\_for is not generating the output.

Thanks for any pointers.

Sanjay.
