I have a model as follows:
class User < ActiveRecord::Base
attr_accessible :name, :email, :twitter, :dribbble, :forrst,
:github, :stackoverflow, :linkedin
# validations, functions, etc.
end
In my view, I would like to iterate over the social accounts (twitter, dribbble, forrst, github, stackoverflow and linkedin) to create text fields for them as follows:
<%= form_for(@user) do |f| %>
<% %w[twitter dribbble forrst github stackoverflow linkedin].each do |account| %>
<%= account %> username: <%= f.text_field :account %>
<% end %>
<% end %>
How do I give the f.text_field the right :account?
Thank you
Try this: