mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
init project
This commit is contained in:
10
app/forms/validate/user.rb
Normal file
10
app/forms/validate/user.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
module Validate
|
||||
class User
|
||||
include ActiveModel::Model
|
||||
|
||||
attr_accessor :nickname, :lastname
|
||||
|
||||
validates :nickname, presence: true, length: { maximum: 10, too_long: "不能超过10个字符" }
|
||||
validates :lastname, presence: true
|
||||
end
|
||||
end
|
||||
9
app/forms/validate/user_extension.rb
Normal file
9
app/forms/validate/user_extension.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
module Validate
|
||||
class UserExtension
|
||||
include ActiveModel::Model
|
||||
attr_accessor :location
|
||||
|
||||
validates :location, presence: true
|
||||
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user