Class: Adminpanel::Section
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Adminpanel::Section
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
Methods included from Base
#correlative_order_gallery, #destroy_unattached_images
Class Method Details
.display_name ⇒ Object
50
51
52
|
# File 'app/models/adminpanel/section.rb', line 50
def self.display_name
I18n.t('model.Section')
end
|
36
37
38
39
40
41
42
43
44
|
# File 'app/models/adminpanel/section.rb', line 36
def self.form_attributes
[
{'description' => {'name' => 'Descripcion', 'description' => 'label', 'label' => 'Seccion'}},
{'name' => {'name' => 'name', 'label' => 'Seccion'}},
{'key' => {'name' => 'key', 'label' => 'Llave'}},
{'page' => {'name' => 'page'}},
{'sectionfiles' => {'type' => 'adminpanel_file_field', 'show' => false}},
]
end
|
.icon ⇒ Object
46
47
48
|
# File 'app/models/adminpanel/section.rb', line 46
def self.icon
'tasks'
end
|
.routes_options ⇒ Object
62
63
64
|
# File 'app/models/adminpanel/section.rb', line 62
def self.routes_options
{ path: collection_name.parameterize, except: [:new, :create, :destroy] }
end
|
Instance Method Details
#description ⇒ Object
54
55
56
57
58
59
60
|
# File 'app/models/adminpanel/section.rb', line 54
def description
if self.has_description
return super.try(:html_safe)
else
return super
end
end
|