Closed jomontanari closed 9 years ago
Hey – I'm a bit snowed under this week as I just moved to Germany from the UK. Just wanted to let you know I'd seen your pull request and I'm not ignoring it.
One thing to consider is that simply replacing ^
and $
with \A
and \z
won't work for every user in every case (e.g. multi-line input), so it'd be nice if this was a config option.
Just wanted to let you know I'd seen your pull request and I'm not ignoring it.
No worries! Thanks for acknowledging.
Actually I would like to add something to make it recognise the case insensitive flag in Ruby, something else I need for Authlogic, I will add to this PR when I've done that.
One thing to consider is that simply replacing ^ and $ with \A and \z won't work for every user in every case (e.g. multi-line input), so it'd be nice if this was a config option.
Is multi-line common in validation? I kept the changes minimal since you have a comment about updating to an XRegExp plugin, so it didn't seem worth being too extensive.
Also, I was targeting a specific use case to get Judge and Authlogic playing nicely together, and this was sufficient to do that (well, it will be with the case insensitivity anyway!)
Is it possible to merge this? I need the ability to specify data-model-class
attr.
@joecorcoran #14, #34, and #36 all solve the same problem. Do you think one of these PR's is stable enough to merge until the XRegExp plugin gets integrated?
@jocranford I was having issues with namspaced classes too and in March my PR was merged so Judge explicitly defines the class as data-klass
(https://github.com/joecorcoran/judge/pull/52). This is now in v2.0.6 and I'm wondering if this fixes your need to override the class with data-model-class
?
There's still the regex issue to solve, but can you update and let me know?
thanks!
I just merged a regex fix from https://github.com/joecorcoran/judge/pull/36. I hate to do this, since your PR was first, but the other fixes here are creating conflicts so I'm going to close this one.
Authlogic uses regular expression validations containing \A and \z (e.g. for email and username validation) added replacement to ^ and $ so that it works on the client side.
Using form_for with a class inside a module meant my input fields had names like module_class_name. The logic to get the module name does not cope well with this, so I added an optional data attribute data-model-name to the input element. If this is present, it's used for uniqueness validations.