Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Use ace (Ajax.org Cloud9 Editor) within your Rails 3 projects
Ruby
Branch: master
Failed to load latest commit information.
lib jQuery is not required anymore
.gitignore initial release
Gemfile initial
README.md initial release
Rakefile initial
ace-rails.gemspec initial release

README.md

ace-rails

This gem provides a generator to download and install ace (Ajax.org Cloud9 Editor) into your Rails 3 project. It also provides some view helper to setup an editor.

Setup

Add the gem to your Gemfile and run bundle.

gem 'ace-rails'

Run the generator to download and install the current version of ace into public/javascripts/ace

rails g ace:install

Usage

Use the helper function to create an editor within your view

<%= ace_editor :mode => :css, :content => "body {\n\tfont-size: 12px;\n}" %>

the :mode option could be one of

[:c_cpp, :coffee, :css, :html, :java, :javascript, :php, :python, :ruby, :xml]

you can also specify a :theme option to change the look and feel of the ace editor. By default ace loads the textmate theme. Currentyl available themes are:

[:clouds, :clouds_midnight, :cobalt, :dawn, :eclipse, :idle_fingers, :kr_theme, :mongo_industrial, :monokai, :pastel_on_dark, :twilight]
Something went wrong with that request. Please try again.