Skip to content

devmarwen/quill-rails

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quill-rails

This gem provides Rails 3/4 asset pipeline loading for Quill, as well as a very convienient helper method to quickly and easily get a nice looking rich text editor.

Installation

Add the following lines to your applications Gemfile:

gem 'quill-rails', '~> 0.1.0'

Then run bundle install to update your application's bundle.

Add Quill to your manifest in app/assets/javascripts/application.js:

//= require quill

You can make the original Quill Snow theme available by adding the following to your manifest in app/assets/stylesheets/application.css:

/*
 *= require quill.snow
*/

Usage

Quick Start

This gem provides a View Helper to automatically create the 'Full Example' demo seen here. Just add the following to your view:

<%= quill_editor %>

and a sexy looking Quill editor will be there!

Useage in Forms

YO! - This is in development and is may change as more functionality is added.

For use in forms, the quill_editor helper creates a hidden field tag whose value is in sync with the text in the editor. By default, it has an id and name of 'quill-value'.

To change both the id or name, just pass a string as the first argument:

<%= quill_editor 'my-name-and-id' %>

To have an id that's different from the name:

<%= quill_editor nil, { name: 'my-name', id: 'my-id' } %>

To have an initial value in the editor:

<%= quill_editor nil, { name: 'my-name', value: 'Awesome!' } %>

Custom Functionality

Because this includes Quill assets, you can also refer to the Quill Documentation to use other, more custom, features.

Changelog

0.1.4

  • Added 'value' option for the helper function (thanks nerdyglasses!)
  • Updated from Quill 0.13 to 0.15

Roadmap

The following features would be nice to have:

  • Configuring the default quill_editor e.g. change wrapper, change theme, etc.
  • Have a form helper tag (f.quill_editor)
  • Parse any RTE input for malicious tags

Contributing

Contributors are very welcome! Fork it, branch it, change it, push it, pull request it, and bop it.

If you have an idea for new features or improving existing features, let me know!

About

Rails 3/4 Asset Pipeline Loading for Quill.js Rich Text Editor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.6%
  • HTML 1.5%
  • Ruby 0.9%