RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Simple forms for Twitter Bootstrap in Rails

Twitter Bootstrap is awesome, but as always, but writing forms that adhere to its markup expectations can be a pain. Especially when you want to incorporate inline error messages.

Enter twitter_bootstrap_form_for, a Rails FormBuilder DSL I created while at RubyConf. It lets you build forms with Bootstrap-compatible markup quickly and easily. All of the Rails form helpers are supported, and only minimal and unobtrusive changes have been made to their method signatures.

To get started, all you need is the Twitter Bootstrap stylesheets included in your assets (the less-rails-bootstrap or twitter-bootstrap-rails projects can help you there) and add gem :twitter_bootstrap_form_for, '~> 1' to your Gemfile.

Happy hacking!

Comments

Thx Stephen, this saved me a lot of customizing. Already using it here: http://www.mittagsplaner.at/restaurants/new lukas

Twitter Bootstrap Markup gem also comes with form for plugin for Rails.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in