/rails_admin_redactor

Adds the redactor edit to Rails Admin

Primary LanguageRubyMIT LicenseMIT

RailsAdminRedactor

RailsAdminRedactor is a plugin that adds the Redactor wysiwyg editor to RailsAdmin.

Getting Started

  1. Add gem "rails_admin_redactor" to your Gemfile
  2. Run bundle install
  3. Add the redactor.css and redactor.js files to your project (get them here)

Usage

RailsAdmin.config do |config|
  config.model 'Blog' do
    edit do
      field :content, :redactor do
        # Optional
        # The location of the redactor.js file. The default is...
        js_location { ActionController::Base.helpers.asset_path('redactor.js') }
        
        # Optional
        # The location of the redactor.css file. The default is...
        css_location { ActionController::Base.helpers.asset_path('redactor.css') }
        
        # Optional
        # The options to be passed to redactor when initializing the editor
        # (see http://imperavi.com/redactor/docs/settings for available options).
        # The default is...
        options { {} }
      end
    end
  end
end