 <p>I don't know what ruby is but talking about bootstrap, I see you missed </p> <p><code>data-toggle</code> which must be written in one phrase with hypen, like this:</p> <pre><code>data-toggle="collapse" </code></pre> <p>or, it maybe:</p> <pre><code>{ type: 'button', class:"navbar-toggle", data-toggle: "collapse", data-target: "navbar-ex1-collapse" } </code></pre>