Class: ExpressAdmin::CodeEditor

Inherits:
ExpressTemplates::Components::Forms::FormComponent
  • Object
show all
Defined in:
app/components/express_admin/code_editor.rb

Instance Method Summary collapse

Instance Method Details

#fieldObject



23
24
25
# File 'app/components/express_admin/code_editor.rb', line 23

def field
  config[:id]
end

#field_helper_optionsObject



15
16
17
# File 'app/components/express_admin/code_editor.rb', line 15

def field_helper_options
  {rows: rows, class: "hide", hidden: true}.merge(super)
end

#field_idObject



35
36
37
# File 'app/components/express_admin/code_editor.rb', line 35

def field_id
  "#{object_type}_#{field}_#{object.id}"
end

#field_nameObject



31
32
33
# File 'app/components/express_admin/code_editor.rb', line 31

def field_name
  "#{object_type}[#{field}]"
end

#objectObject



19
20
21
# File 'app/components/express_admin/code_editor.rb', line 19

def object
  self.send resource_name
end

#object_typeObject



39
40
41
# File 'app/components/express_admin/code_editor.rb', line 39

def object_type
  object.class.to_s.demodulize.underscore
end

#rowsObject



27
28
29
# File 'app/components/express_admin/code_editor.rb', line 27

def rows
  config[:rows]
end