SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Displaying specific error messages with Rails

    Is it possible to get specific error messages to appear within various areas of a form versus getting the standard list of error messages that Ruby on Rails seems to default too?

    Or even in addition to.

    I have a long form and it would be great if I could add specific text messages in areas of the form that fail validation.

    Thanks,
    Bryan

  2. #2
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can do that:

    Code:
    @the_record.errors.on(:the_field)
    gives you an array of errors for the_field.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •