hash enumeration and using outside arguments
I have a form builder and the normal |f| variable. In the middle I'd like to iterate over some hash and get a list of keys by which to build the form. How can I incorporate "f" as an argument to the enumerator.
<%= form_for ..... do |f| %>
<% available_types.each do |k,v| %>
<%= f.text_filed :selection, :value => v %>
<% end %>
<% end %>
As you can see in the code above, "f" is outsi开发者_如何转开发de of the scope. Ideas?
f
should still be in the scope. You misspelled text_field
though.
精彩评论