Twitter-Bootstrap: Simple_form nicht machen horizontaler form oder korrigieren Sie die HTML-Ausgabe?

Ich weiß nicht, warum Ihr nicht duplizieren, wie im Beispiel. Wenn ich den folgenden code in dieser form:

<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :class => "form-horizontal" } ) do |f| %>
<%= f.input :user_name, :input_html => { :class => "span3" }, :hint => "just letters and numbers please." %>
<% end %>

Recht, jetzt sieht es wie folgt aus:

Twitter-Bootstrap: Simple_form nicht machen horizontaler form oder korrigieren Sie die HTML-Ausgabe?

Wenn ich es will, so zu sein wie dieses (das erste Beispiel hier: http://simple-form-bootstrap.plataformatec.com.br/articles/new).

Twitter-Bootstrap: Simple_form nicht machen horizontaler form oder korrigieren Sie die HTML-Ausgabe?

Liegt das Problem in der HTML generiert wird. Mein HTML ist:

<div class="input string optional">
 <label for="user_user_name" class="string optional"> User name</label>
  <input type="text" size="50" name="user[user_name]" maxlength="25" id="user_user_name" class="string optional span3">
   <span class="hint">no spaces or special characters, just letters and numbers please</span>
</div>

Und Simple_forms HTML:

<div class="control-group string required">
 <label for="article_name" class="string required">
  <abbr title="required">*</abbr> Name
 </label>
  <div class="controls">
   <input type="text" size="50" name="article[name]" id="article_name" class="string required span6">
    <p class="help-block">add your article title here</p>
  </div>
</div>

Völlig anders. Ich denke, das Bootstrap-generator nicht erzeugen? Was denkst du? Was soll ich tun?

Ressourcen

https://github.com/plataformatec/simple_form

https://github.com/rafaelfranca/simple_form-bootstrap

http://simple-form-bootstrap.plataformatec.com.br/

InformationsquelleAutor LearningRoR | 2012-02-16

Schreibe einen Kommentar