Skip to content

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

Notifications You must be signed in to change notification settings

jbfeldis/ace-rails

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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]

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%