Re: Editing Multiple Models in One Form

Hi I am a newbie and have a question. I dont follow the operation

# <% for @task in @project.tasks %>
#   <%= error_messages_for :task %>
#   <% fields_for "task[]" do |f| %>
#     <p><%= f.text_field :name %></p>
#   <% end %>
# <% end %>

when you create a @task. Does that mean we could create instance variables on templates as well cuz normally while iterating its just
<% for task in @project.tasks %>


and the second thing that I don't follow is the
<% fields_for "task[]" do |f| %>

what does that do. I do understand the concept of the fields_for but I dont get the "task[]" bit.

I would greatly appreciate any explanation on this. Excuse me if this seems suprisingly silly.