wymeditor for rails asset pipeline
Ruby JavaScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 5 commits ahead, 1 commit behind hayesr:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
script
spec
tasks
vendor/assets
.gitignore
Gemfile
Gemfile.lock
MIT-LICENSE
README.md
Rakefile
wymeditor-rails.gemspec

README.md

WymeditorRails

This project rocks and uses MIT-LICENSE.

Help

Installation

Very simple!

  • Add this line to Gemfile
  gem 'wymeditor-rails'
  • Add this line to `app/assets/javascripts/application.js
  //= require jquery.wymeditor

Using with ActiveAdmin

With asset pipeling support, wymeditor can be easily integrated with active-admin. After installing, all you need to do is write some javascript like this:

Lets say we have articles model whose content needs to be edited

  • First bind wymeditor to textarea where content is present.
  $('#article_content').wymeditor({ basePath: "/assets/" });
  • Bind a callback to article submit button to reflect the content from editor before updating the article
  $('#edit_article').submit(function() {
    $('#article_content').html($.wymeditors(0).xhtml());
    return true;
  });