some real models
This commit is contained in:
8
app/main/models/blocks_model.rb
Normal file
8
app/main/models/blocks_model.rb
Normal file
@ -0,0 +1,8 @@
|
||||
class BlocksModel < Volt::ArrayModel
|
||||
|
||||
def instruction_changed old , ins
|
||||
self.last._class_name = "" if( page._blocks.length > 0)
|
||||
self << { :name => ins.to_s , :class_name => "active" }
|
||||
end
|
||||
|
||||
end
|
10
app/main/models/register_model.rb
Normal file
10
app/main/models/register_model.rb
Normal file
@ -0,0 +1,10 @@
|
||||
class RegisterModel < Volt::Model
|
||||
field :name
|
||||
field :value
|
||||
|
||||
def register_changed reg , old , ins
|
||||
self.last._class_name = "" if( page._blocks.length > 0)
|
||||
self << { :name => ins.to_s , :class_name => "active" }
|
||||
end
|
||||
|
||||
end
|
@ -1,12 +0,0 @@
|
||||
# By default Volt generates this User model which inherits from Volt::User,
|
||||
# you can rename this if you want.
|
||||
class User < Volt::User
|
||||
# login_field is set to :email by default and can be changed to :username
|
||||
# in config/app.rb
|
||||
field login_field
|
||||
field :name
|
||||
|
||||
validate login_field, unique: true, length: 8
|
||||
validate :email, email: true
|
||||
|
||||
end
|
Reference in New Issue
Block a user