As far as I know, Rails doesn't generate form attribute for input control 
tags because it's assumed that form content is captured and rendered within 
a block.

# typical rails form usage
> <%= form_for(object) do |f| %>
>   <%= f.text_field :bam %>
> <% end %>
> # generates
> <form ...>
>   ...
>   <input name="object[bam]" type="text">
> </form>



The assumption has a limitation that content must not contain another form 
element. [w3 
spec](http://www.w3.org/TR/2011/WD-html5-20110525/association-of-controls-and-forms.html#association-of-controls-and-forms)
 
defines a set of attributes on input tags to associate themselves to their 
form.

 

> # decoupled control and its form
> <form id="flexible"...>
> </form>
> # control input can be placed outside of form tag
> # but still be associated to its form
> <input form="flexible" name="object[bam]" type="text">



Will Rails support auto generation of form attribute on input controls, 
that are outside of form tag? Is this feature on the roadmap?

Quick hacks are most welcomed :)

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to