f.inputs can cause double rendering if output on accident #125

evanworley opened this Issue Nov 20, 2009 · 1 comment


None yet
2 participants
<% semantic_form_for @model do |f| %>
    <%= f.inputs :name => "My Inputs" %>
        <%= f.input :field %>
<% end %>

This causes the form to be double rendered. Now I know what you're thinking, how could one be so silly to use <%= and then indent the next line? Well in my particular case I am using HAML, so the error is much more subtle. Haml version below..

- semantic_form_for @model do |f|
    - f.inputs :name => "My Inputs"
        = f.input :field

I realize this is user error, but perhaps this case could be detected and an error reported?


justinfrench commented Nov 21, 2009

There's no way that I know of to catch this. The damage is done as soon as the = is read, as far as I can tell. Closing, will gladly accept magical patches :)

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment