-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MultiValueInput should pass an index to build_text_field
- Loading branch information
Showing
2 changed files
with
21 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,10 @@ def input(wrapper_options) | |
<ul class="listing"> | ||
HTML | ||
|
||
collection.each do |value| | ||
collection.each_with_index do |value, index| | ||
markup << <<-HTML | ||
<li class="field-wrapper"> | ||
#{build_text_field(value)} | ||
#{build_text_field(value, index)} | ||
</li> | ||
HTML | ||
end | ||
|
@@ -25,7 +25,10 @@ def input(wrapper_options) | |
|
||
private | ||
|
||
def build_text_field(value) | ||
# Although the 'index' parameter is not used in this implementation it is useful in an | ||
# an overridden version of this method, especially when the field is a complex object and | ||
# the override defines nested fields. | ||
def build_text_field(value, index) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jcoyne
Author
Member
|
||
options = input_html_options.dup | ||
|
||
options[:value] = value | ||
|
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
@jcoyne are they overriding this method? It's private, which strikes me as odd.