免责声明: 此项目不再维护。
Bootsy is a WYSIWYG editor for Rails based on Bootstrap-wysihtml5 with image uploads using CarrierWave.
bundle install it:gem 'bootsy'
bundle install
config/routes.rb:Rails.application.routes.draw do
mount Bootsy::Engine => '/bootsy', as: 'bootsy'
...
end
In your app/assets/javascripts/application.js, put this after
requiring jQuery and Bootstrap:
//= require bootsy
In your app/assets/stylesheets/application.css, put this line after
requiring Bootstrap:
*= require bootsy
bundle exec rake bootsy:install:migrations
bundle exec rake db:migrate
Just call bootsy_area in your FormBuilder instances, the
same way you'd call textarea. Example:
Bootsy will group the uploaded images as galleries and associate them to one of
your models. For instance, if you have a Post model and you want to use bootsy_area
with it, you must include the Bootsy::Container module:
class Post
You can customize Bootsy through a hash of editor_options:
You can enable and disable features as you like. For instance, if you don't want link and color features:
Available options are: :blockquote, :font_styles, :emphasis, :lists, :html, :link, :image and :color.
By default Bootsy alerts the user about unsaved changes if the page is closed or reloaded. You can disable this feature with:
If you don't want to have image uploads, just call bootsy_area in a form builder not
associated to a Bootsy::Container model. This way users will still be able to insert
images in the text area using an external image URL.
You can set the default editor options, image sizes available (small, medium,
large and/or its original), dimensions and more. Create a copy of Bootsy's initalizer
file
in your config/initializers and feel free to uncomment and change the options
as you like.
You can translate Bootsy to your own language. Simply create a locale file for
it in your config/locales directory similar to Bootsy's master English file.
You also need to translate Bootsy on the JavaScript side. Just follow
this example.
Bootsy will try to guess the locale based on the lang attribute of the page's tag. You can set the locale directly by setting a `data-bootsy-locale` attribute on your.
MIT License. Copyright 2012-2017 Volmer Campos Soares
暂无开放 Issues,或尚未同步最近议题。