# Looking for a framework to report user feedback and form errors

**URL:** <https://www.ruby-forum.com/t/looking-for-a-framework-to-report-user-feedback-and-form-errors/142462>\
**Category:** Rails\
**Created:** [July 8, 2008, 7:45am UTC](https://www.ruby-forum.com/t/looking-for-a-framework-to-report-user-feedback-and-form-errors/142462 "2008-07-08T07:45:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nahabed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b77776/32.png) [@nahabed](https://www.ruby-forum.com/u/nahabed)\
**Post date:** [July 8, 2008, 7:45am UTC](https://www.ruby-forum.com/t/looking-for-a-framework-to-report-user-feedback-and-form-errors/142462/1 "2008-07-08T07:45:48Z")

</div>

We’re building our first Rails app and looking for a consistent way to  
provide feedback messages; things like success messages like “your  
password changed successfully” or form errors with the form field  
highlighted in red (you know).

I’ve read that Rails provides a framework for this but we’ve diverged  
in how we do this in our app and would to reign things in 🙂

Thanks!

---

<div class="post-metadata">

**Author:** ![nahabed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b77776/32.png) [@nahabed](https://www.ruby-forum.com/u/nahabed)\
**Post date:** [July 8, 2008, 8:13am UTC](https://www.ruby-forum.com/t/looking-for-a-framework-to-report-user-feedback-and-form-errors/142462/2 "2008-07-08T08:13:57Z")

</div>

nahabed wrote:

> We’re building our first Rails app and looking for a consistent way to  
> provide feedback messages; things like success messages like “your  
> password changed successfully” or form errors with the form field  
> highlighted in red (you know).

Welcome in Rails and Ruby. For your question, ruby on rails handles all  
error messages depending to your wanted. Example :

you want form errors with highlighted messages, rails handles it in  
model, you can see validates function with :messages =\> “…” or

def validate  
…  
errors.add(:attribute, “cant be bla…bla…bla”)  
end

But if you want show notificatin after input data like “your password  
changed successfully”, you can use flash[:notice]

in your view just call :

\<% if flash[:notice] -%\>  
\<%= flash[:notice] %\>  
\<% end %\>

for hightlighted error messages, in your view is just calling :

\<%= error\_messages\_for ‘model\_name\_1’, ‘mode\_name\_2’ %\>

i hope my description can help your problem, good luck.

reinhart  
[http://teapoci.blogspot.com](http://teapoci.blogspot.com)
