-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proxy FormBuilder view calls through TemplateProxy
One major drawback to the original `ViewPartialFormBuilder::FormBuilder` implementation was its obligation to totally re-create the underlying `FormBuilder` behavior, including minor implementation details like calling `objectify_options` and setting and unsetting instance variables like `@emitted_hidden_id = true if method == :id`. Another drawback is that if the method wasn't declared, there would be no means of declaring a corresponding view partial. This is exactly what happened with the `date_select` helper (fixed in [#13][]). This new implementation proxies calls to render ActionView instances through the `ViewPartialFormBuilder::TemplateProxy`, which first attempts to resolve a view partial that matches the method call. It is not without its quirks. For example, the `#button` and `#submit` methods are special case, because they invoke a method on the `@template` that is suffixed with `_tag`. Additionally, the `#label` helper is a special case because of the optional nature of the `text = nil` parameter. [#13]: #13
- Loading branch information
1 parent
d56cfb0
commit 9f0c669
Showing
4 changed files
with
121 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.