baidu ueditor for rails, precompile codes from tinymce-rails
Add this line to your application's Gemfile:
gem 'baidu_ueditor_rails', github: 'doabit/baidu_ueditor_rails'
And then execute:
$ bundle
Usage:
rails g baidu_ueditor_rails:install
Then add codes in application.js
//= require baidu_ueditor
//= require ueditor_custom_config
In ueditor_custom_config.js, it looks like:
//ueditor custom config
(function () {
window.CUSTOM_CONFIG = {
// Insert your config code
// toolbars: [
// ['Source','Undo','Redo','Cleardoc','SearchReplace','InsertImage','WordImage','Bold','ForeColor','JustifyLeft',
// 'JustifyCenter','JustifyRight','JustifyJustify','RemoveFormat','FormatMatch','AutoTypeSet','PastePlain',
// 'FontSize','Preview','Link','FullScreen', 'PageBreak', 'InsertTable','Attachment','InsertVideo']
// ]
};
jQuery.extend(window.UEDITOR_CONFIG, window.CUSTOM_CONFIG);
})();
you can write your custom config in
window.CUSTOM_CONFIG = {
//.........
};
<script type="text/javascript">
var editor = new UE.ui.Editor();
editor.render("your_textarea_id");
</script>
- Add upload image and file.
- Add form helpers.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request