html_escape seems to be broken after upgrading to Rails 3.1 - ruby-on-rails

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 .

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.

Related

undefined method `boolean_label_class=' for SimpleForm

Attempting to run migration for my Rails app pixel_paisan is getting an error reading; NoMethodError: undefined method `boolean_label_class=' for SimpleForm:Module. Gist for the trace at https://gist.github.com/nbarnes/9796454dc28be9792284. Source code for error-production app at https://github.com/nbarnes/pixel_paisan.
I've tried uninstalling and reinstalling simple_form, doesn't help. Update entire gemset, doesn't help. Different ruby versions via RVM, doesn't help. Plain vanilla Rails app, created in an attempt to reproduce the bug works fine. Google doesn't know about my issue.
Does anybody know anything about this? I'm rapidly running out of angles to attack it from.
Short answer: update your simple_form gem to 3.1.0+. You have simple_form (3.0.2)
Longer answer: See https://github.com/rafaelfranca/simple_form-bootstrap/issues/44 which seems to be someone who had the same issue where the answer is to upgrade to simple_form 3.1.0+ whereas your Gemfile has simple_form (3.0.2)

Rails 2.3.8 tiny mce issue - undefined method `uses_tiny_mce'

I am facing an issue in my application with tiny mce.
All the gem version & ruby version is OK on my system, but it is giving me error
= undefined method `uses_tiny_mce'
Here i installed the tiny_mce gem. COnfigured it correctely, but still there is an issue.
Please help.
Did you include
config.gem 'tiny_mce'
in config/environment.rb?
I have used this gem in the past too, but have stopped using it. I figured it complicated the setup and deployment of my Rails apps. Since then I have just used the TinyMCE editor by itself. Since it is 100% javascript, it does not touch any Ruby code which keeps things better organized.
I was not using this as a plugin.
I have followed the steps given in the,
http://enginey.googlecode.com/svn/trunk/vendor/plugins/tiny_mce/README.rdoc
Steps :
script/plugin install git://github.com/kete/tiny_mce.git
rake tiny_mce:install
my issue got resolved.

Migration to rails 3

I am migrating a rails 2.3.5 project to rails 3.
I get a lot of errors in the lines when i am using:
params[:something]
that i have to change ti with:
request.path_parameters[:something]
It this right? I am unable to found something about this in rails3 migration guides.
My controller:
def details
foo=Tag.find(params[:id])
end
and i get the following error:
ActiveRecord::RecordNotFound
Couldn't find Tag without an ID
You are missing the ":" in params[:id].
That may be the reason you're receiving the error.
Aside from your error, which is probably due to the missing : as tapioco123 pointed out, are you using the rails_upgrade plugin?
https://github.com/rails/rails_upgrade
There are also three excellent screencasts by Ryan Bates at railscasts on upgrading from rails 2.3.5 to 3.0.
http://railscasts.com/episodes?utf8=%E2%9C%93&search=upgrading+rails+3
This will help you switch over to some of the new features rails 3 offers and prepare you for rails 3.1 which is expected to be released soon and may not show all the depreciation messages that rails 3.0 will.
Good luck with upgrading.

Jasper Reports in Ruby on Rails

I have assigned to use jasperserver reports in a rails application.
There is a plugin for jasperserver to use in Ruby application.
https://github.com/gunark/jasperserver-client
I want to know whether this plugin can use in my rails 3 version of application.
I've checked in railsplugin.org .But it shows "no result found".
I'l be please if u people gave me any help link.
According to the wiki, the author recommends you install it as a gem & not as a plugin. They go on to give an example of how to use the gem in a rails project on this wiki page.
I haven't used this, but your compatibility issues probably won't be with rails. Maybe the ruby version or soap4r version - but there don't seem to be any rails dependencies here.
You maybe use this simple ruby script for this => http://www.redrails.com.br/2013/03/07/ruby-client-para-rest-api-do-jasper-report-server/

Rails 2.3.9, adding ActiveScaffold, getting in `alias_method': undefined method `number_of_pages' for class `Paginator'

I have AS (as a plugin) working in another app just fine (I dont remember this
issue...) - its also using Rails 2.3.9, on same dev box.
Now trying to add it to a new app and getting this error when running
the webrick, script/server:
/Users/kimptoc/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.9/lib/
active_support/core_ext/module/aliasing.rb:33:in `alias_method':
undefined method `number_of_pages' for class `Paginator' (NameError)
from /Users/kimptoc/.rvm/gems/ruby-1.8.7-p302/gems/
activesupport-2.3.9/lib/active_support/core_ext/module/aliasing.rb:
33:in `alias_method_chain'
from /Users/kimptoc/Documents/ruby/borisbikestats/vendor/plugins/
active_scaffold/lib/extensions/paginator_extensions.rb:9
I couldn't find any previous references to this error.
Embarassingly I dont know which version of AS I am using successfully... it says 1.2RC1 in the CHANGELOG file, but I seem to remember trying a few of the forks...(is there somewhere I can see which fork is in use...). I have tried using the the 'main' activescaffold in the new project, but it fails as above, but so does using the same plugin that is in the working project :(
Thanks in advance for any pointers as to what I am doing wrong.
Thanks,
Chris
PS Just realised that new Rails was using Rails 3 and old/working one was 2.3.9. It seems you need to use an alternate branch of AS for Rails 3, like this : https://github.com/vhochstein/active_scaffold/wiki
This is just a guess, but built in pagination was removed in Rails 2 as I recall, and you needed to install the classic_pagination plugin to get that functionality back.
I only used ActiveScaffold once, but the error there says paginator_extensions.rb ... it's probably monkey patching the old Rails paginator? Therefore the class exists but the number_of_pages method doesn't.

Resources