plataformatec/simple_form — Issue #365: HTML ID collision when outputting the same form multiple times
Author: damian
Created: 2011-11-25 09:20:23+00:00
State: open

If you render the same form on a page multiple times the id of the form remains the same which causes invalid markup when passed through a validator. See the generated markup below.

```html

...

```

This can be handled manually using a counter or something similar so the HTML ID's don't collide.

```ruby
simple_form_for @post, :html => { :id => "post_#{post_counter}" } do |f|
```

It'd be great if simple_form could handle this out of the box without having to use something like the above to get valid HTML markup. I know Formtastic tackles this issue by using a namespace to ensure the form id's remain unique e.g.

```ruby
semantic_form_for @post, :namespace => 'cat_form'
```