bootstrap-wysihtml5-rails

Published on

Bootstrap Wysihtml5 Rails is the easiest way to add a beautiful rich text editor to your rails application.

This is how it looks like:

bootstrap-wysihtml5

Using it is very easy. Just put this in your Gemfile and bundle install.

gem 'jquery-rails'
gem 'bootstrap-sass'

gem 'bootstrap-wysihtml5-rails'

app/assets/stylesheets/application.css

*= require bootstrap-wysihtml5

app/assets/javascripts/application.js

//= require bootstrap-wysihtml5

Optionally, you may include all locales like this.

//= require bootstrap-wysihtml5/locales

Or just add the ones that you want

//= require bootstrap-wysihtml5/locales/de-DE
//= require bootstrap-wysihtml5/locales/es-ES

Finally, let’s use it:

<textarea id="some-textarea" class='wysihtml5' placeholder="Enter text ..."></textarea>

// You want to put this initialization code in a file
// in you app/assets/javascripts folder.
<script type="text/javascript">
  $(document).ready(function(){

    $('.wysihtml5').each(function(i, elem) {
      $(elem).wysihtml5();
    });

  })
</script>

bootstrap-wysihtml5 has a lot of options you can make use of. Check their readme.

https://github.com/Nerian/bootstrap-wysihtml5-rails