-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
I am trying to set multiple placeholders, one for each form field, from an array of placeholders. It sounds like the __nested_field_for_replace_with_index__ string would be useful, but I'm getting the following error:
undefined local variable or method `__nested_field_for_replace_with_index__' for #<#<Class:0x007f7fa3821188>:0x007f7f9ef8a578>
Here's my code:
/ _form.html.haml
= vertical_form_for study, url: study_questions_path(study.slug), method: :post do |f|
= f.nested_fields_for :questions do |question|
= render partial: 'form_fields', locals: { f: question, placeholder: Question::PLACEHOLDERS[__nested_field_for_replace_with_index__] }
/_form_fields.html.haml
= f.input :body, placeholder: placeholder, label: 'Open-ended question', as: :text, input_html: { class: 'question-textarea' }
I also tried just putting it there as a string, but then I get no implicit conversion of String into Integer as the error instead.
Metadata
Metadata
Assignees
Labels
No labels