Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call format again for resolved value #333

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

edgarMeinart
Copy link

No description provided.

@CLAassistant
Copy link

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.

@coveralls
Copy link

coveralls commented Nov 26, 2020

Coverage Status

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

@spohlenz
Copy link
Member

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.

@edgarMeinart
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants