0

I've inherited some old Rails 2.3 code. I want to use the standard rails <%= form_for %> and <%= remote_form_for %> helpers. I also want to use Twitter Bootstrap, and have the <label> <input> be properly nested in the Bootstrap classed divs, like so:

<div class="control-group">
  <label class="control-label" for="inputEmail">Email</label>
  <div class="controls">
    <input type="text" id="inputEmail" placeholder="Email">
  </div>
</div>

Is there a good gem/method to do this? We have TONS of <form> elements in our app, so ideally I'd love to have a helper method or gem to handle this for me.

I've previously used twitter-bootstrap-rails gem, but its asset-pipeline driven. We've considered adding the asset pipeline to Rails 2 using this method: http://pivotallabs.com/giving-rails-2-the-asset-pipeline/ but would like to consider solutions that don't rely on this as well.

1

1 Answer 1

0

I went ahead and forked a gem and backported it for Rails 2.3. It allows perfect Bootstrap 2.3 markup:

https://github.com/Lordnibbler/twitter_bootstrap_form_for/blob/rails-2.3/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.