ruby-on-railsactivesupporthtml-escape

html_escape seems to be broken after upgrading to Rails 3.1


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 .


Solution

  • 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.