Class: RailsAdmin::Config::Fields::Types::RichEditor

Inherits:
Text
  • Object
show all
Defined in:
lib/rich/rails_admin/config/fields/types/rich_editor.rb

Instance Method Summary collapse

Instance Method Details

#scope_idObject



24
25
26
# File 'lib/rich/rails_admin/config/fields/types/rich_editor.rb', line 24

def scope_id
  bindings[:object].id
end

#scope_typeObject



14
15
16
17
18
19
20
21
22
# File 'lib/rich/rails_admin/config/fields/types/rich_editor.rb', line 14

def scope_type

  # Use association name if existent
  if bindings[:form].object_name.scan(/.*\[(.*)_attributes\]/).nil?
    bindings[:form].object_name
  else
    bindings[:form].object_name.scan(/.*\[(.*)_attributes\]/).to_s
  end
end