Sha256: 8463880d14132e4f9e935284c353ba7aa24d01c11ce6d6fe7d6fa5c69bbfe052

Contents?: true

Size: 726 Bytes

Versions: 14

Compression:

Stored size: 726 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-inline
  = form.select type_column, type_collection, {include_blank: true, selected: selected_type}, class: "form-control", 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)}, class: "form-control"

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
rails_admin-1.4.3 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-1.4.2 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-1.4.1 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-1.4.0 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-1.3.0 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-1.2.0 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-1.1.1 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-1.1.0 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-1.0.0 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-1.0.0.rc app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-0.8.1 app/views/rails_admin/main/_form_polymorphic_association.html.haml
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/rails_admin-0.7.0/app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-0.7.0 app/views/rails_admin/main/_form_polymorphic_association.html.haml
rails_admin-0.6.8 app/views/rails_admin/main/_form_polymorphic_association.html.haml