zorab47 / active_admin-sortable_tree

Show ActiveAdmin index as a nested tree with drag'n'drop
MIT License
162 stars 127 forks source link

Displaying other fields #49

Closed leotrieu closed 9 years ago

leotrieu commented 9 years ago

Hi, thanks for your effort making this gem. I'm just wondering if there is a way to display other fields of an Object. For example, my object have: title, note, tag and I want to display them all. But right now, it looks like I can display only one of them with "label :field"

index :as => :sortable do
    label :title # item content
        actions
end
zorab47 commented 9 years ago

Currently only a single label field is available. One workaround would be to provide an new attribute method that concatenates the fields you want to display.

There is a desire to show more information per item, but it isn't straightforward to align the additional fields in an intuitive way.

leotrieu commented 9 years ago

That sounds cool to me. Thank you!

scarroll32 commented 4 years ago

I did this with embedded HTML like this (on the model):

  def full_title
    "#{target_title} <i>#{fluent_title}</i>".html_safe
  end