Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F401848
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
Thu, Feb 20, 1:37 PM
Size
226 B
Mime Type
text/x-ruby
Expires
Sat, Feb 22, 1:37 PM (19 h, 33 s)
Engine
blob
Format
Raw Data
Handle
191827
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