0

I have a project that uses the WYSIWYG editor 'wysihat-engine' by Dutch guys from 80beans . It use to work fine with Rails version 3.0.9 , but after upgrading to 3.1.0 the wysihat-engine cannot find 'html_escape' from ERB::Util (ActiveSupport 3.1.0) , giving me this error message :

undefined method `html_escape' for #<ActionView::Helpers::InstanceTag:my-wysihat-editor- instance>

I've fixed it (verrrry lamely , indeed) by defining the 'html_escape' inside 'wysihat-engine.rb' , but I'm sure , there's a reason not to do it this way :).

My questions : 1. Is this a bug of the new version of Rails ? 2. Is there a better choice for WYSIWYG editor for a Rails 3.1 projects ?

Thank you in advance .

R Milushev
  • 4,295
  • 3
  • 27
  • 35

1 Answers1

0

The wysihat-engine doesn't seem to be compatible with Rails 3.

I've tried to install it in a fresh Rails 3.1 application, but the generator fails when it tries to generate a database migration:

$ rails generate wysihat

~/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.1.0/lib/rails/generators/migration.rb:30:in `next_migration_number': NotImplementedError (NotImplementedError)
    from ~/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.1.0/lib/rails/generators/migration.rb:49:in `migration_template'
    from ~/.rvm/gems/ruby-1.9.2-p290@rails31/gems/wysihat-engine-0.1.13/lib/generators/wysihat_generator.rb:60:in `install_wysihat'

I'm surprised you even got as far as the html_escape error you posted. Fixing this would take some poking in the source code. You could ask the developer for info.

rdvdijk
  • 4,400
  • 26
  • 30
  • Yes , it' s not easy ;) This error comes from one missed 'self' in wysihat-generator.rb , on declaration of the protected 'next_migration_number(dirname)' , it should be added to be like this : def self.next_migration_number.......... – R Milushev Oct 01 '11 at 14:50