GithubHelp home page GithubHelp logo

bjorntrondsen / tinymce-rails Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spohlenz/tinymce-rails

0.0 2.0 0.0 710 KB

Integration of TinyMCE with the Rails 3.1 asset pipeline

License: MIT License

Ruby 97.84% JavaScript 2.16%

tinymce-rails's Introduction

Rails 3.1 Integration for TinyMCE

The tinymce-rails gem integrates the TinyMCE editor with the Rails 3.1 asset pipeline.

Instructions

1. Add tinymce-rails to your Gemfile

gem 'tinymce-rails'

Then run bundle install.

2a. Use TinyMCE with the jQuery extension

Add to your application.js:

//= require tinymce-jquery

and use TinyMCE in your view:

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

<script type="text/javascript">
  $(function() {
    $('textarea').tinymce({
      theme: 'advanced'
    });
  });
</script>

2b. Use TinyMCE without jQuery

Add to your application.js:

//= require tinymce

Use TinyMCE in your view:

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

<script type="text/javascript">
  tinyMCE.init({
    mode: 'textareas',
    theme: 'advanced'
  });
</script>

Custom Plugins & Skins

To use custom plugins or skins, simply add the files to your asset load path so that they are locatable at a path beneath tinymce/plugins/ or tinymce/themes/advanced/skins/.

For example, a plugin called mycustomplugin could have its main JS file at app/assets/javascripts/tinymce/plugins/mycustomplugin/editor_plugin.js.

Any files with a path beginning with tinymce/ will be automatically precompiled.

Updating

When new versions of TinyMCE are released, simply update the tinymce-rails gem to the latest version. There is no need to run any extra rake tasks (apart from rake assets:precompile).

tinymce-rails's People

Contributors

spohlenz avatar mariovisic avatar did avatar bjorntrondsen avatar nexneo avatar

Watchers

 avatar James Cloos 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.