Class: Adminpanel::Section

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Base
Defined in:
app/models/adminpanel/section.rb

Constant Summary collapse

VALID_EMAIL_REGEX =
/\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.display_nameObject



52
53
54
# File 'app/models/adminpanel/section.rb', line 52

def self.display_name
	'Seccion'
end

.form_attributesObject



38
39
40
41
42
43
44
45
46
# File 'app/models/adminpanel/section.rb', line 38

def self.form_attributes
	[
		{'description' => {'name' => 'Descripcion', 'description' => 'label', 'label' => 'Seccion'}},
		{'name' => {'name' => 'name', 'label' => 'Seccion'}},
		{'key' => {'name' => 'key', 'label' => 'Llave'}},
		{'page' => {'name' => 'page'}},
	]

end

.iconObject



48
49
50
# File 'app/models/adminpanel/section.rb', line 48

def self.icon
	'tasks'
end

Instance Method Details

#descriptionObject



56
57
58
59
60
61
62
# File 'app/models/adminpanel/section.rb', line 56

def description
	if self.has_description && !self.attributes['description'].nil?
		return self.attributes['description'].html_safe
	else
		return self.attributes['description']
	end
end