ryanb/nested_form — Issue #102: link_to_add Raises 'no block given (yield)' error on Rails 3.1.1
Author: davidakachaos
Created: 2011-10-17 13:27:09+00:00
State: open

Ok, so i have this form in a rails 3.1.1 app;

```ruby
<%= nested_form_for @brand do |f| %>
<% if @brand.errors.any? %>

<%= pluralize(@brand.errors.count, "error") %> prohibited this brand from being saved:

<% @brand.errors.full_messages.each do |msg| %>

<%= msg %>

<% end %>

<% end %>

<%= f.label :name, "Name" %>

<%= f.text_field :name %>

<%= f.label :active, "Active?" %>

<%= f.check_box :active %>

<%= f.fields_for :emails do |emails_form| %>
<%= emails_form.text_field :number %>
<%= emails_form.link_to_remove "remove" %>
<% end %>
<%= f.link_to_add("Add emails", :emails) %>

<%= f.submit %>

<% end %>
```

This crashes with the error:
```
LocalJumpError in Brands#new

no block given (yield)
```
But when I remove the link_to_add part of the code, the form renders.

What could it be?