Class: Adminpanel::Section
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Adminpanel::Section
- 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_name ⇒ Object
54 55 56 |
# File 'app/models/adminpanel/section.rb', line 54 def self.display_name I18n.t('model.Section') end |
.form_attributes ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'app/models/adminpanel/section.rb', line 40 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
50 51 52 |
# File 'app/models/adminpanel/section.rb', line 50 def self.icon 'tasks' end |
.routes_options ⇒ Object
66 67 68 |
# File 'app/models/adminpanel/section.rb', line 66 def self. { path: collection_name.parameterize, except: [:new, :create, :destroy] } end |
Instance Method Details
#description ⇒ Object
58 59 60 61 62 63 64 |
# File 'app/models/adminpanel/section.rb', line 58 def description if self.has_description && !self.attributes['description'].nil? return self.attributes['description'].html_safe else return self.attributes['description'] end end |