am new to rails, am using summernote for my app, I have followed the
whole
documentation and did as per the documentation. but, the editor is not
dispalying in my text_area. means it just shows a blank text area box
with
out any buttons, the details are below.
In my gem file:
gem ‘simple_form’, ‘2.1.1’
gem ‘summernote-rails’, ‘0.4.0’
gem ‘bootstrap-sass’, ‘3.1.1.1’
gem ‘bootstrap-will_paginate’, ‘0.0.10’
gem ‘font-awesome-sass-rails’, ‘3.0.2.2’
In app/assets/javascripts/application.js
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require summernote.min
//= require_tree .
in app/assets/stylesheets/application.css
*= require_self
*= require_bootstrap
*= require_font-awesome
*= require_summernote
*= require_tree .
In my events/_form.html.erb
<%= f.input :error_detail, label:‘Summary’, class:‘summernote’,
input_html:
{class:‘form-control’} %>
in my app/assets/javascripts/events.js.coffee
$ ->
to set summernote object
You should change ‘#event_error_detail’ to your textarea input id
summer_note = $(’#event_error_detail’)
to call summernote editor
summer_note.summernote
to set options
height:300
lang: ‘en’
toolbar: [
# ['insert', ['picture', 'link']], // no insert buttons
# ["table", ["table"]],
# ["style", ["style"]],
# ["fontsize", ["fontsize"]],
# ["color", ["color"]],
# ["style", ["bold", "italic", "underline", "clear"]],
# ["para", ["ul", "ol", "paragraph"]],
# ["height", ["height"]],
# ["help", ["help"]]
#]
to set code for summernote
summer_note.code summer_note.val()
to get code for summernote
summer_note.closest(‘form’).submit ->
alert $(’#event_error_detail’).code()
summer_note.val summer_note.code()
true
The error am getting in my firefox browser’s error console
TypeError: summer_note.summernote is not a function
MY ENVIRONMENT DETAILS: Ruby 1.9.3 and Rails 3.2.8, ubuntu 12.4
Please help me where am i doing wrong…, Please I need help.