SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    error validation in ROR

    I am new to ROR. I am trying to validate the text field and want to display the error messages if they are blank.
    These text fields are not related to database. Hence I can not use the following
    <%= error_messages_for "user" %>

    Any help would be greatly appreciated.

  2. #2
    SitePoint Enthusiast ianpurton's Avatar
    Join Date
    Jul 2004
    Location
    Isle of Dogs
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can add fields to your model even if they are not in the database. They won't get persisted of course.

    You can also validate these fields using the standard rails validations.

  3. #3
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help! I want to maintain their states also. Is it a good idea to store them in a session ? Also, can you provide me link on standard rails validations, if you have any ?


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
  •