Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F462078
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
Sun, May 18, 8:00 PM
Size
226 B
Mime Type
text/x-ruby
Expires
Tue, May 20, 8:00 PM (1 d, 40 m)
Engine
blob
Format
Raw Data
Handle
220457
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