The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Rails - validates_unlike: plugin para validar que una atributo no cumpla un RegExp

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Edgar Gonzalez

Posts: 560
Nickname: egg
Registered: Feb, 2006

Edgar Gonzalez is Chief Technology Officer for VALHALLA project
Rails - validates_unlike: plugin para validar que una atributo no cumpla un RegExp Posted: Jul 11, 2006 6:03 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Edgar Gonzalez.
Original Post: Rails - validates_unlike: plugin para validar que una atributo no cumpla un RegExp
Feed Title: La Cara Oscura del Desarrollo de Software
Feed URL: http://www.lacaraoscura.com/feed/
Feed Description: Our experiences day after day about software development: programming languages, standards, design patterns, tools and tips. (blog in spanish)
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Edgar Gonzalez
Latest Posts From La Cara Oscura del Desarrollo de Software

Advertisement
(english version) Haciendo algunos ajustes a rubycorner.com me consigo con que necesito validar que un atributo de un modelo no cumpla con una expresión regular dada. Mi primera alternativa fue definir un método validate en mi modelo, similar a: def validate   if my_field =~ /html|http|onclick|onmouseover/     errors.add("my_field", "should not contain html, http, onclick or onmouseover.")   end end Sin embargo este [...]

Read: Rails - validates_unlike: plugin para validar que una atributo no cumpla un RegExp

Topic: The Least Surprised in "UnboundMyth'd" Previous Topic   Next Topic Topic: p^P is Pastie Straight from Vim

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use