On 17 Jan 2008, at 14:47, Tom Hughes wrote: > In message <[EMAIL PROTECTED]> > Gervase Markham <[EMAIL PROTECTED]> wrote: > >> Tom Hughes wrote: >>> It's not complaining about the file (it hasn't even looked at the >>> contents of the file) but rather about the contents of the upload >>> form. Specifially about the tags field - most likely you have put >>> in a character it does not allow (/ ; , . and ? are not allowed) >> >> Aha. Given that many tagging implementations expect tags to be >> separated >> with commas, would it be too much for the upload mechanism to >> strip out >> commas rather than barfing on them? >> >> Also, perhaps: >> >> "The 'tags' field you wrote contains an invalid character" >> >> would be a better error message. For bonus points, give the >> contents of >> the field and say which character was illegal. > > Um - it's all rails stuff basically. I just say: > > validates_format_of :tag, :with => /^[^\/;.,?]*$/ > > and rails does the rest... I can probably give it a custom > message if I look at the doco. > validates_format_of :tag, :with => /^[^\/;.,?]*$/, :message => "may only contain basic letters or numbers"
I was reading that bit of the rails book yesterday :-) John _______________________________________________ dev mailing list [email protected] http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev

