Search code examples
jqueryruby-on-rails-3wysihtml5

jQuery: function only works if followed by a broken function


It's exactly what it sounds like. I've got a groovy little plugin in my Rails app that rich-texts field areas. It works fine, except for the fact that two toolbars appear when there should only be one.

$('#user_address').wysihtml5();

If, however, I put beneath it a similar function that refers to nothing:

$('#this_thing').this_is_broken();

Then it fixes the two toolbar issues but breaks all the other jQuery functions I've got going on.

Any ideas? Sounds like a bug to me.


Solution

  • Thanks to @Cyle Hunter for the answer: I was including the JS file twice.