# Is there "errors.add" the controller?

**URL:** <https://www.ruby-forum.com/t/is-there-errors-add-the-controller/111824>\
**Category:** Rails\
**Created:** [August 11, 2007, 6:12pm UTC](https://www.ruby-forum.com/t/is-there-errors-add-the-controller/111824 "2007-08-11T18:12:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [August 11, 2007, 6:12pm UTC](https://www.ruby-forum.com/t/is-there-errors-add-the-controller/111824/1 "2007-08-11T18:12:46Z")

</div>

Hi,  
I am familiar with the “errors.add” on the model and use this to display  
errors to the user.

I have some processing in the controller that can generate errors before  
I get to the point where I pass control to the model.

I want to raise errors and display an error panel on the user’s screen,  
in a similar fashion to \<%= error\_messages\_for ‘model’ %\>.

Can this be done?

I tried to get around this using a partial but I misunderstood. I wrote  
a partial and, when I get the errors I can display this. However, I’d  
hoped it would display in the main page for the action but it just  
displays on its own. I realise I’m just misunderstanding how it works as  
I get up to speed, but any pointers would be great…

I expect there is a nice way to include a template inside another based  
on a condition in the controller, I just don’t know what it is!

Thanks!
