Wait, what? You posted the correct code in your original post, but this
isn’t that code. Line 50 here is saying, “call the data_type method on
question object with these three parameters”. The generated accessor
doesn’t understand the parameters, and you get the error.
If you want to call a method whose name is selected at runtime, you need
to use send.
Been a while, I had the closing bracket in the wrong spot:
send needs all the params, it was erroring on , if i put the closing
bracket right after the data_type or name
<%= person_question.send(question.data_type.to_sym, question.name,
=> ‘text_field’) %>