Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Use ace (Ajax.org Cloud9 Editor) within your Rails 3 projects

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile initial May 11, 2011
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 ace-rails.gemspec
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.