Disclaimer: this project is no longer maintained.
ruby gem 'bootsy'
Mount Bootsy at the beginning of your
config/routes.rb: ```ruby Rails.application.routes.draw do mount Bootsy::Engine => '/bootsy', as: 'bootsy'
//= require bootsy
app/assets/stylesheets/application.css, put this line after requiring Bootstrap:
*= require bootsy
console bundle exec rake bootsy:install:migrations bundle exec rake db:migrate
FormBuilderinstances, the same way you'd call
textarea. Example: ```erb <%= formfor(@post) do |f| %> <%= f.label :title %> <%= f.textfield :title %>
<%= f.label :content %> <%= f.bootsy_area :content %>
<%= f.submit %> <% end %> ```
Bootsy will group the uploaded images as galleries and associate them to one of your models. For instance, if you have a
Postmodel and you want to use
bootsy_areawith it, you must include the
ruby class Post < ActiveRecord::Base include Bootsy::Container end
Don't forget to ensure the association between your model objects with Bootsy image galleries. For
strong_parameters, you must whitelist the
bootsy_image_gallery_idparameter in your controller: ```ruby private
def postparams params.require(:post).permit(:title, :content, :bootsyimagegalleryid) end ```
You can use
bootsyas an input type in
SimpleForm::FormBuilderinstances. Example: ```erb <%= simpleformfor @post do |f| %> <%= f.input :title %>
<%= f.input :content, as: :bootsy %>
<%= f.button :submit %> <% end %> ```
You can customize Bootsy through a hash of
You can enable and disable features as you like. For instance, if you don't want link and color features:
erbAvailable options are:
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_areain a form builder not associated to a
Bootsy::Containermodel. 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/initializersand 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/localesdirectory similar to Bootsy's master English file.
langattribute of the page's tag. You can set the locale directly by setting a
data-bootsy-localeattribute on your .
MIT License. Copyright 2012-2017 Volmer Campos Soares