SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Prompt Box in RoR

    I would like to add a prompt to a membership validation method that I
    have which basically validates a number that the user enters. If the
    number is validated, their info is saved to a database, but if not, a
    prompt pops up saying "Invalid Membership Number," or something to that
    effect. The thing is I have no idea how to do this. I know that in a
    link_to helper I can say :confirm => "Really?". The rub here is, that I
    need this box to only popup if a condition fails and defently not
    everytime a button (in this case I am using a form and a bitton) is
    clicked. Is there anyway I can get this type of action from my
    controller? Thanks in advance,

    ~TRS

  2. #2
    SitePoint Zealot
    Join Date
    May 2003
    Location
    Sarasota, FL
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about the flash method? http://api.rubyonrails.org/classes/A...ler/Flash.html

    Just setup your controller such that when validation fails you flash a message.
    Chris Bloom
    Web Application Developer


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
  •