Giter VIP home page Giter VIP logo

redactor-rails's Introduction

Rails 4 Integration for Redactor

(Paperclip No-Devise Edition with Bourbon/Compass support and unset editor styles)

The redactor-rails gem integrates the Redactor editor with the Rails asset pipeline.

This gem bundles Redactor version 9.1.9 which is the most recent version as of December 12, 2013. Check Redactor's changelog for further updates.

Installation

Add this line to your application's Gemfile:

gem 'redactor-rails', github: "kausters/redactor-rails"

And then execute:

$ bundle install

Add to application.rb:

require 'redactor-rails'

Now generate models for store uploading files

ActiveRecord + carrierwave

gem "carrierwave"
gem "mini_magick"

$ rails generate redactor:install

$ rake db:migrate

ActiveRecord + paperclip

gem "paperclip"

$ rails generate redactor:install --backend=paperclip

$ rake db:migrate

Mongoid + carrierwave

gem "carrierwave"
gem "carrierwave-mongoid", require: "carrierwave/mongoid"
gem "mini_magick"

$ rails generate redactor:install

Include the Redactor assets

Add to your application.js:

//= require redactor-rails

Add to your application.css.scss:

@import 'redactor-rails';

Initialize Redactor

For each textarea that you want to use with Redactor, add the "redactor" class and ensure it has a unique ID:

<%= text_area_tag :editor, "", class: "redactor", rows: 40, cols: 120 %>

Customize the Redactor editor

If you need change some config in Redactor, you can

$ rails generate redactor:config

Then generate app/assets/redactor-rails/config.js.

See the Redactor Documentation for a full list of configuration options.

If You Want To setup a new language in Redactor you should do two things:

In you file app/assets/redactor-rails/config.js set option

lang: 'lv'

and

Add to your application.js (version >= 0.4)

//= require redactor-rails/langs/lv

or add to your layout

<%= redactor_lang('lv') %>

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Special Thanks

wildjcrt (Jerry Lee)

Statement

redactor-rails part of reference galetahub/ckeditor project.

redactor-rails uses MIT-LICENSE. Rock!!!!!

License

the redactor-rails project is MIT-LICENSE.

You may use Redactor for non-commercial websites for free, however, we do not guarantee any technical support.

Redactor has 3 different licenses for commercial use. For details please see License Agreement.

redactor-rails's People

Contributors

agis avatar anicet avatar artursbraucs avatar feipinghunag avatar jhanggi avatar joemsak avatar kausters avatar meal avatar phuwanart avatar rubinsh avatar sammylin avatar sergio1990 avatar snooc avatar terracatta avatar zmillman avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.