index as: :reorderable_table do
column :position
column :full_name
column 'Category', &:category_name
column :avatar do |fm|
attachment_img(fm.avatar)
end
column :banner do |fm|
attachment_img(fm.banner)
end
column :description do |fm|
fm.description.try(:truncate, 100)
end
column :short_profile do |fm|
fm.short_profile.try(:truncate, 100)
end
actions
end
Referring to the code above, even with some custom helper methods, I still find myself having to repeat the column do apply_logic end a lot.
How can I write helper methods that wrap around the 'column' function so that my output can become something like this:
index as: :reorderable_table do
column :position
column :full_name
rename_column :category_name, 'Category'
img_column :avatar
img_column :banner
truncate_column :description
truncate_column :short_profile
actions
end