Class: Locomotive::EditableModel

Inherits:
EditableElement show all
Defined in:
app/models/locomotive/editable_model.rb

Instance Attribute Summary

Attributes inherited from EditableElement

#block_name, #block_priority

Instance Method Summary collapse

Methods inherited from EditableElement

#_type, #add_current_locale, #block_label, #by_priority, #disabled?, #page, #page_id, #path, #slug

Instance Method Details

#content_typeObject



4
5
6
# File 'app/models/locomotive/editable_model.rb', line 4

def content_type
  @content_type ||= self.page.site.content_types.by_id_or_slug(self.slug).first
end

#content_type?Boolean

Returns:



12
13
14
# File 'app/models/locomotive/editable_model.rb', line 12

def content_type?
  !content_type.nil?
end

#labelObject



8
9
10
# File 'app/models/locomotive/editable_model.rb', line 8

def label
  self.content_type.name
end