-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Make FormHelper extension required_label behave the same as label for i18n #2954
Conversation
@johanb removing it sounds great. |
… and don't adhere to Rails default i18n behavior. Discussed here: refinery#2954 (comment)
@parndt I've removed it. This is however used here: https://github.com/refinery/refinerycms-inquiries/blob/master/app/views/refinery/inquiries/inquiries/_form.html.erb you want me to whip up a PR for the extensions hosted under "refinery" that depend on this to ? |
@johanb that'd be lovely, thanks! |
… default_rails_i18n_behavior
… default_rails_i18n_behavior
Accidentally removed my branch, which closed the PR. Sorry |
Merged into a single commit b4b20cd, thanks! |
This breaks |
Missed that @ghoppe, will investigate. Thanks for reporting it. |
For your consideration:
Refinery has a
required_label
form helper method. This intended behavior ofrequired_label
seems to be to append a " *" to the content and add a required class. Currently however it changes Rails default fallback behavior of thelabel
method for forms.From the docs:
emphasis mine
Refinery's current implementation does not respect this behavior and jumps straight to the AR method described in the rails docs:
I've made a PR which changes this behavior to mimic the Rails fallback behavior without changing the arity of the method definition of
required_label
(for compatibility sake).While changing this behavior I couldn't find existing specs, is this correct or did I look in the wrong places ?
TODO
label
methodUpdate
I'd actually prefer to remove this entire thing from Refinery, it solves something so trivial. I'd be happy to change this PR to that.. Seems it's not used in this: #2922