Using an array object in a form helper

I have an array of the attributes of an object that I would like to
use to generate a form. For example, I’d like to say

   <% fields_for :questions do |f|%>
     <% for c in @attributes %>
         <%= f.text_field [c] %>

how can I use an element of the array in place of [c] ? I normally
would put “:attributename”

Try:

<%= f.text_field eval(":#{c}") %>

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs