Closed Spone closed 2 years ago
When developing custom components, it's sometimes useful to access the label string directly (without calling f.label). We could add a helper for this to our FieldComponent.
f.label
FieldComponent
First draft, reusing this:
def label_text content ||= ActionView::Helpers::Tags::Translator.new(object, object_name, method_name, scope: "helpers.label").translate content ||= method_name.humanize content end
When developing custom components, it's sometimes useful to access the label string directly (without calling
f.label
). We could add a helper for this to ourFieldComponent
.First draft, reusing this: