Skip to content

IceskYsl/rails_kindeditor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kindeditor for rails3

Installation

gem install rails_kindeditor

After you install rails_kindeditor and add it to your Gemfile, you need to run the generator:

rails generate rails_kindeditor:install

The generator will copy kindeditor to your application. When you are done, you are ready to add migration using the generator:

rails generate rails_kindeditor:migration

The generator will copy migration to your application. When you are done, remember run rake db:migrate:

rake db:migrate

Don’t forget add this to your Gemfile

gem "carrierwave", "~> 0.5.4"
gem "rails_kindeditor"

MongoDB Support

add this to your Gemfile

gem "mongoid", "~> 2.0"
gem "bson_ext", "~> 1.2"

migration using the generator:

rails generate rails_kindeditor:migration  -o mongoid

Usage

Basically include <%= include_kindeditor_if_needed %> under the <head> element of your in your layout file:

<%= include_kindeditor_if_needed %>

In your controller, use include_kindeditor method to load kindeditor javascript:

include_kindeditor

You can load kindeditor javascript only in some action if you needed:

include_kindeditor :only => [:new, :edit]
include_kindeditor :except => [:index, :show, :destroy, :create]

Assign your textarea with id

:id => "kindeditor_id"

You can config kindeditor by rails_kindeditor-init.js file:

public/javascripts/kindeditor/kindeditor-init.js

License

MIT License. Copyright 2011

About

kindeditor for rails3

Resources

Stars

Watchers

Forks

Packages

No packages published