2013-07-19 99 views
0

錯誤的軌道是不工作application.And我想包括描述文本編輯器field.But它顯示在控制檯類似錯誤,文本編輯器wysihtml5不加載和顯示我使用WYSIHTML5文本編輯器控制檯

Uncaught TypeError: Cannot set property 'mo-MD' of undefined ar-AR.js:6 
Uncaught TypeError: Cannot set property 'bg-BG' of undefined bg-BG.js:6 
Uncaught TypeError: Cannot set property 'ca-CT' of undefined ca-CT.js:6 
Uncaught TypeError: Cannot set property 'cs-CZ' of undefined cs-CZ.js:6 
Uncaught TypeError: Cannot set property 'da-DK' of undefined da-DK.js:6 
Uncaught TypeError: Cannot set property 'de-DE' of undefined de-DE.js:6 
Uncaught TypeError: Cannot set property 'el-GR' of undefined el-GR.js:6 
Uncaught TypeError: Cannot set property 'es-AR' of undefined es-AR.js:7 
Uncaught TypeError: Cannot set property 'es-ES' of undefined es-ES.js:6 
Uncaught TypeError: Cannot set property 'fr-FR' of undefined fr-FR.js:6 
Uncaught TypeError: Cannot set property 'nl-NL' of undefined fr-NL.js:6 
Uncaught TypeError: Cannot set property 'hr-HR' of undefined hr-HR.js:6 
Uncaught TypeError: Cannot set property 'it-IT' of undefined it-IT.js:6 
Uncaught TypeError: Cannot set property 'ja-JP' of undefined ja-JP.js:6 
Uncaught TypeError: Cannot set property 'ko-KR' of undefined ko-KR.js:6 
Uncaught TypeError: Cannot set property 'lt-LT' of undefined lt-LT.js:6 
Uncaught TypeError: Cannot set property 'mo-MD' of undefined mo-MD.js:6 
Uncaught TypeError: Cannot set property 'nb-NB' of undefined nb-NB.js:6 
Uncaught TypeError: Cannot set property 'nl-NL' of undefined nl-NL.js:6 
Uncaught TypeError: Cannot set property 'pl-PL' of undefined pl-PL.js:6 
Uncaught TypeError: Cannot set property 'pt-BR' of undefined pt-BR.js:6 
Uncaught TypeError: Cannot set property 'ru-RU' of undefined ru-RU.js:6 
Uncaught TypeError: Cannot set property 'sk-SK' of undefined sk-SK.js:6 
Uncaught TypeError: Cannot set property 'sv-SE' of undefined sv-SE.js:6 
Uncaught TypeError: Cannot set property 'tr-TR' of undefined tr-TR.js:6 
Uncaught TypeError: Cannot set property 'ua-UA' of undefined ua-UA.js:6 
Uncaught TypeError: Cannot set property 'zh-CN' of undefined zh-CN.js:6 
Uncaught TypeError: Cannot set property 'zh-TW' of undefined zh-TW.js:6 
Uncaught TypeError: Cannot read property 'editor' of undefined announcements.js:1 

JS文件

$('.wysihtml5').wysihtml5(); 

的application.js

// This is a manifest file that'll be compiled into application.js, which will include all the files 
// listed below. 
// 
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 
// 
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 
// the compiled file. 
// 
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD 
// GO AFTER THE REQUIRES BELOW. 
// 
//= require jquery 
//= require jquery_ujs 
//= require jquery.ui.datepicker 
//= require twitter/bootstrap 
//= require bootstrap-datepicker 
//= require bootstrap-datetimepicker 
//= require bootstrap-wysihtml5 
//= require bootstrap-wysihtml5/locales 
//= require dataTables/jquery.dataTables 
//= require dataTables/jquery.dataTables.bootstrap 
//= require jquery.timepicker.js 
//= require rails.validations 
//= require rails.validations.custom 
//= require rails.validations.simple_form 
//= require_tree . 

application.css

*= require_self 
*= require datepicker 
*= require datetimepicker 
*= require dataTables/jquery.dataTables.bootstrap 
*= require DT_bootstrap 
*= require bootstrap-wysihtml5 
*= require jquery.ui.datepicker 
*= require jquery.timepicker.css 
*= require_tree . 

的Gemfile

source 'https://rubygems.org' 

gem 'rails', '3.2.13' 
gem 'mysql2' 
gem 'jquery-rails' 
gem 'rspec-rails' 
gem 'simple_form' 
gem 'country_select' 
gem 'bcrypt-ruby', '~> 3.0.0' 
gem "paperclip", :git => "git://github.com/thoughtbot/paperclip.git" 
gem 'jquery-fileupload-rails' 
gem 'kendoui-rails' 
gem 'wicked' 
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git' 
gem 'jquery-datatables-rails', github: 'rweng/jquery-datatables-rails' 
gem 'bootstrap-wysihtml5-rails', :require => 'bootstrap-wysihtml5-rails', 
           :git => 'git://github.com/Nerian/bootstrap-wysihtml5-rails.git' 
gem 'client_side_validations' 
gem 'client_side_validations-simple_form' 
gem 'validates_timeliness', '~> 3.0' 
group :assets do 
    gem 'sass-rails', '~> 3.2.5' 
    gem 'coffee-rails', '~> 3.2.1' 
    gem 'uglifier', '>= 1.0.3' 
    gem 'less-rails' 
    gem "therubyracer" 
    gem 'jquery-ui-rails' 
    gem 'jquery-timepicker-rails' 
end 

_form.html.erb文件

<%= simple_form_for @announcement, :html => { :class => 'form-horizontal' } do |f| %> 
    <%= f.input :name %><br/> 
    <%= f.input :description, as: 'text', :input_html =>{:rows =>8, :cols => 15, :class => 'wysihtml5' } %> 
    <div class="form-actions"> 
    <%= f.button :submit, :class => 'btn-primary' %> 
    <%= link_to t('.cancel', :default => t("helpers.links.cancel")), 
       announcements_path, :class => 'btn' %> 
    </div> 
<% end %> 

我已經遍及嘗試day.even,雖然我得到error.Please幫我...

+0

你只是扔了一些隨機文件。閱讀錯誤信息幷包含重要文件。 –

回答

1

如果您的資產文件夾中包含這些文件bootstrap-wysihtml5.js和bootstrap-wysihtml5.min.js。只要你可以刪除這些文件。我認爲,它會起作用。

+0

雅其工作正常 – user2310209

相關問題