spohlenz / tinymce-rails

Integration of TinyMCE with the Rails asset pipeline
Other
816 stars 258 forks source link

integrate tinymce into rails + backbone #92

Closed Asmmund closed 11 years ago

Asmmund commented 11 years ago

i have to include in tinymce in the app based on backbone-on-rails https://github.com/meleyal/backbone-on-rails

I've followed all the instructions for rails app. tried to include tinymce before & after backbone files in application.js my backbone template <textarea class="tinymce" id="article_body" rows='40' cols='120' > <%= @article.get('body') %> </textarea>

But tinymce controlls fail to initialize. Could you help me?

Asmmund commented 11 years ago

Update 1 I tried initing tinymce in the template & this: in edit.jst.eco

<% tinyMCE.execCommand "mceAddControl", true, "article_body"+@article.get('id')%>

Controls o ver texterea appear only after manual refresh (f5)

Update 2 I've tried adding execCommand method to the render method of the view i'm interested displaying tinymce in: class Notes.Views.ArticleEdit render: -> $(@el).html(@template(article: @model)) tinyMCE.execCommand "mceAddControl", false, "article_body"+@model.get('id') this No changes compared with update 1

spohlenz commented 11 years ago

Are you able to post some more context for the parts of your code that relate to TinyMCE? I'm having a hard time understanding how your code fits together and what errors you are getting.

Even better, if you could upload an example app to GitHub, that would be perfect.

Asmmund commented 11 years ago

This question on stackoverflow http://stackoverflow.com/questions/15219060/integrate-tinymce-into-rails-backbone and repo on github https://github.com/Asmmund/notes

Asmmund commented 11 years ago

You're probably interested in the last commit https://github.com/Asmmund/notes/commit/d93b7e3f017271b97a8de0138330b5c6509d9d6b

Asmmund commented 11 years ago

Error solved https://github.com/Asmmund/notes/commit/c74ccd00596964e84013f4ea0d43ba46b551c579