У меня есть следующий код:
def bootstrap_form_field(f, method, text, &block)
content_tag :div, :class => div_classes(f, method) do
f.label(method.to_sym, text) +
content_tag(:div, :class => "input") do
concat(yield + error_display(f.object, method))
end
end
end
который я ожидаю получить что-то вроде этого:
<div class="clearfix error">
<label for="xlInput">X-Large Input</label>
<div class="input">
<input class="xlarge error" id="xlInput" name="xlInput" size="30" type="text">
<span class="help-inline">Small snippet of help text</span>
</div>
</div>
от вызова, такого как:
<%= bootstrap_form_field f, :password, "Password" do %>
<%= f.password_field :password %>
<% end -%>
но мой урожай, кажется, уступает дважды:
<div class="clearfix error">
<label for="user_password">Password</label>
<div class="input">
<input id="user_password" name="user[password]" size="30" type="password">
<input id="user_password" name="user[password]" size="30" type="password">
<span class="help-inline">can't be blank</span>
</div>
</div>
Как так?