Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codykrieger/ace-rails-ap
The Ajax.org Cloud9 Editor (Ace) for the Rails 3.1+ asset pipeline.
https://github.com/codykrieger/ace-rails-ap
Last synced: 1 day ago
JSON representation
The Ajax.org Cloud9 Editor (Ace) for the Rails 3.1+ asset pipeline.
- Host: GitHub
- URL: https://github.com/codykrieger/ace-rails-ap
- Owner: codykrieger
- License: mit
- Created: 2011-10-03T22:53:00.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2023-01-12T10:06:48.000Z (almost 2 years ago)
- Last Synced: 2024-10-30T02:36:43.946Z (15 days ago)
- Language: Ruby
- Homepage:
- Size: 8.36 MB
- Stars: 134
- Watchers: 9
- Forks: 63
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ace-rails-ap
The [Ajax.org Cloud9 Editor (Ace)](https://github.com/ajaxorg/ace) for the Rails 3.1+ asset
pipeline.## Installation
In your Gemfile, add:
```ruby
gem 'ace-rails-ap'
```Then execute `bundle` and restart your server.
Add in your application.js file:
```javascript
//= require ace-rails-ap
```To include a theme or mode, add them in your application.js file:
```javascript
//= require ace/theme-sometheme
//= require ace/mode-somemode
```Workers and modes don't need to be included in your application.js file, as they can also be loaded dynamically (see below).
## Rails Asset Pipeline
Ace will dynamically load the JavaScript files for workers and modes at run-time.
ace-rails-ap plays nicely with the Rails asset pipeline by automatically configuring the precompilation of the workers and modes,
and by setting up Ace to load the fingerprinted files. You have nothing to do, it just works.## Migrate from previous version of ace-rails-ap
You may have done some customisation to allow ace-rails-ap to work in production, such as adding the worker files in
`assets.precompile` of your application.rb and/or using `ace.config.setModuleUrl` function. You can remove those.Also replace the previous javascript manifest instruction `//= require ace/ace` by the new `//= require ace-rails-ap`, and remove
all workers from your javascript manifest.## Limiting asset build to certain modes
By default, all mode files are included in the asset build. If you want to limit the asset build to only those modes which you will use, create an initializer like the following:
```ruby
Ace::Rails.include_modes = %w{html yaml}
```