Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F5493040
name_validator.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Sep 29, 9:21 PM
Size
226 B
Mime Type
text/x-ruby
Expires
Thu, Oct 1, 9:21 PM (1 d, 1 h)
Engine
blob
Format
Raw Data
Handle
458469
Attached To
rARCHIVING archiving
name_validator.rb
View Options
class
NameValidator
<
ActiveModel
::
Validator
def
validate
(
record
)
unless
record
.
name
=~
/^[a-zA-Z0-9\.\-_ ]+$/
record
.
errors
[
:name
]
<<
"Can only contain numbers, letters, space, '.', '-' and '_'"
end
end
end
Event Timeline
Log In to Comment