you can add something like this below your field to achieve this

<%= error_message_on :user, :active, "Status  ", ' ', ' ' %>

On Sep 10, 2:26 am, Tim <[EMAIL PROTECTED]> wrote:
> I know this may be nit-picky, but I'd like to show a more friendly
> field name when displaying error messages.
>
> For example, I've got a form field labeled "E-Mail Address" but the
> error message looks like this:
>
> * Email address must be valid
>
> A better example is that I've got a field on the User model that is
> called "active". The form field is labeled "Status" that allows the
> user to choose active or inactive, but the error message looks like
> this.
>
> * Active must be Active or Inactive
>
> Is there a better way to display errors, or something I can add to the
> model, where I can specify a custom value for the field name?
>
> This is what I'm using...
>
> <% @user.errors.each_full do |message| %>
>         <li><%= message %></li>
> <% end %>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to