Sha256: ff2ac9f16186900d6a8ed5756c94553c7eeac363c12fd9e4ea4412b9acce8048

Contents?: true

Size: 691 Bytes

Versions: 6

Compression:

Stored size: 691 Bytes

Contents

:ruby
  type_collection = field.polymorphic_type_collection
  type_column = field.association.foreign_type.to_s
  selected_type = field.bindings[:object].send(type_column)
  collection = field.associated_collection(selected_type)
  selected = field.bindings[:object].send(field.association.name)
  column_type_dom_id = form.dom_id(field).sub(field.method_name.to_s, type_column)

= form.select type_column, type_collection, {include_blank: true, selected: selected_type}, id: column_type_dom_id, data: { polymorphic: true, urls: field.polymorphic_type_urls.to_json }
= form.select field.method_name, collection, {include_blank: true, selected: selected.try(:id)}, style: "margin-left:10px;"

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_admin-0.6.7 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-0.6.6 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-0.6.5 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-0.6.4 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-0.6.3 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-0.6.2 app/views/rails_admin/main/_form_polymorphic_association.html.haml