Gem for editarea
Add this line to your application's Gemfile:
gem 'editarea-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install editarea-rails
add to application.js and copy static files
$ rails generate editarea:install
view code:
.row-fluid
.span12.content_unit.section
%form
%textarea#textarea{:name => "content", :style => "width:100%", :rows => 15}
define_method :name, &block
javascript code:
:javascript
editAreaLoader.init({
id: "textarea", // textarea id
syntax: "ruby", // syntax to be uses for highgliting
start_highlight: true, // to display with highlight mode on start-up
show_line_colors: true,
replace_tab_by_spaces: 4,
allow_toggle: false
});
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request