trestle icon indicating copy to clipboard operation
trestle copied to clipboard

Call format again for resolved value

Open edgarMeinart opened this issue 5 years ago • 4 comments

edgarMeinart avatar Nov 26 '20 18:11 edgarMeinart

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Nov 26 '20 18:11 CLAassistant

Coverage Status

Coverage remained the same at 91.579% when pulling 3a7a054e4a6f4cb1801090ef31a1b522ab491a72 on edgarMeinart:patch-1 into df9619a10ce7accb4ad8331df19cf0f539b2a9da on TrestleAdmin:master.

coveralls avatar Nov 26 '20 18:11 coveralls

Could you give an example of what use case this is solving for you? What are you returning from your Trestle.config.display_methods instance method?

This just doesn't feel like the right way to achieve this but my mind is open.

spohlenz avatar Dec 15 '20 22:12 spohlenz

use case example

# Document ActiveRecord model
class Document
  belongs_to :organization
end

# Organization ActiveRecord model
class Organization
  has_many :documents
end

# Trestle admin /documents_admin.rb
...
table do 
  column :organization, truncate: { length: 20 }
end
...

For the current situation - (for example) in case when name of the subject is long - it takes up an unreasonable width of cell

This minor fix will allow to use such helpers as "truncate" to limit the output

edgarMeinart avatar Dec 21 '20 22:12 edgarMeinart