<%= f.label :name %> <%= f.text_field :name %>

<% @user_attribute.attrs.each_with_index do |attr, i| %>

<%= hidden_field_tag "user_attribute[attrs][][key]", attr["key"] %> <%= text_field_tag "user_attribute[attrs][][name]", attr["name"] %> <%= select_tag "user_attribute[attrs][][type]", options_for_select(["text_field", "select"], attr["type"]) %> (remove)

<% end -%>

<%= text_field_tag "user_attribute[attrs][][key]", "" %> <%= text_field_tag "user_attribute[attrs][][name]", "" %> <%= select_tag "user_attribute[attrs][][type]", options_for_select(["text_field"], "") %> (remove)

(add)
<% content_for :page_specific_javascript do %> <% end -%>