Note that there are some explanatory texts on larger screens.

plurals
  1. POTwitter-Bootstrap: Simple_form not making horizontal form or correct HTML output?
    primarykey
    data
    text
    <p>I don't know why Its not duplicating like the example. When I put the following code to have this form:</p> <pre><code>&lt;%= simple_form_for(resource, :as =&gt; resource_name, :url =&gt; registration_path(resource_name), :html =&gt; { :class =&gt; "form-horizontal" } ) do |f| %&gt; &lt;%= f.input :user_name, :input_html =&gt; { :class =&gt; "span3" }, :hint =&gt; "just letters and numbers please." %&gt; &lt;% end %&gt; </code></pre> <p>Right now it looks like this:</p> <p><img src="https://i.stack.imgur.com/RKudu.png" alt="enter image description here"></p> <p>When I want it to be like this (the first example here: <a href="http://simple-form-bootstrap.plataformatec.com.br/articles/new" rel="nofollow noreferrer">http://simple-form-bootstrap.plataformatec.com.br/articles/new</a>).</p> <p><img src="https://i.stack.imgur.com/DgFL8.png" alt="enter image description here"></p> <p>The Problem lies in the HTML being generated. My HTML is:</p> <pre><code>&lt;div class="input string optional"&gt; &lt;label for="user_user_name" class="string optional"&gt; User name&lt;/label&gt; &lt;input type="text" size="50" name="user[user_name]" maxlength="25" id="user_user_name" class="string optional span3"&gt; &lt;span class="hint"&gt;no spaces or special characters, just letters and numbers please&lt;/span&gt; &lt;/div&gt; </code></pre> <p>And Simple_forms HTML:</p> <pre><code>&lt;div class="control-group string required"&gt; &lt;label for="article_name" class="string required"&gt; &lt;abbr title="required"&gt;*&lt;/abbr&gt; Name &lt;/label&gt; &lt;div class="controls"&gt; &lt;input type="text" size="50" name="article[name]" id="article_name" class="string required span6"&gt; &lt;p class="help-block"&gt;add your article title here&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Totally different. I'm thinking the Bootstrap generator doesn't generate? What do you think? What should I do?</p> <p><em>resources</em></p> <p><a href="https://github.com/plataformatec/simple_form" rel="nofollow noreferrer">https://github.com/plataformatec/simple_form</a></p> <p><a href="https://github.com/rafaelfranca/simple_form-bootstrap" rel="nofollow noreferrer">https://github.com/rafaelfranca/simple_form-bootstrap</a></p> <p><a href="http://simple-form-bootstrap.plataformatec.com.br/" rel="nofollow noreferrer">http://simple-form-bootstrap.plataformatec.com.br/</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload