Skip to content

Conversation

tfe
Copy link
Contributor

@tfe tfe commented Feb 4, 2015

I wanted a clean way to customize the display of attribute values for (primarily) the index/search results view and for un-editable fields on the show page.

What I've ended up creating seems pretty close to acting like a decorator/presenter, but it does fit in nicely with the established models in Upmin. It uses the same rendering pipeline and partial naming scheme. Partials should be created under app/views/upmin/partials/attribute_values.

Perhaps someone has a better idea of how to implement this, perhaps leveraging Draper or one of the existing decorator gems? One thing that would be nice is an ability to customize the attribute label along with the value, but under this model it would require yet another folder full of (usually) one-line partials.

tfe added 2 commits February 4, 2015 00:08
…lay using different partials than the normal attribute partial (which usually has form elements).
@jdurand
Copy link
Contributor

jdurand commented Apr 17, 2015

I'm not sure what this does. How is this different from just overriding an attribute partial?
Can you add an example to the README?

@tfe
Copy link
Contributor Author

tfe commented Apr 28, 2015

It's been a long time since I looked at this and I'd need to refresh my memory about why I did it. It's possible that I overlooked an existing way of accomplishing the same thing. But I think my goal was to customize only the value part of the display, rather than the whole form field or label/value combination.

And yes, I neglected documentation on all this stuff. It just came out of my own needs for a client project, so publicly consumable features wasn't my primary goal.

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.

2 participants