I'm upgrading a rails project from 3.2 to 5.2. The docs in prototype-rails
[github][1] say the support is not confirmed for Rails 4.1 and above. But right now, in the process of upgrading I'm still in Rails 4.0.13 and the gem no longer works.
I'm not very familiar with Prototype RJS and Scriptaculous which seem to be what the gem adds to rails project.
What is the best way to replace this gem and maintain the RJS functionality?
Has anyone had to do it and what solution have you found to be the most effective?
UPDATE
Sorry folks. Project long past and been inactive. The way I managed to get past this was by getting rid of the gem and adding the code for prototype under vendor and then requiring it in my application.js
under assets.
By adding the two files below to my project and requiring them, as I mentioned above, I managed to get it working.
https://github.com/rails/prototype-rails/blob/master/vendor/assets/javascripts/prototype_ujs.js
https://github.com/rails/prototype-rails/blob/master/vendor/assets/javascripts/prototype.js
So in my project now I have:
vendor/assets/javascripts/
prototype.js
prototype.ujs.js
and in my assets/javascripts/application.js
I required those files after jquery
//= require prototype
//= require prototype_ujs
I did have to make some changes to my views too. They ware using .js.rjs
extensions. I turned them into .js.erb
and made the necessary syntax changes to get it working.
Something like this
page.replace_html 'info', :partial => 'shared/info'
page['info'].show
Was refactored into this
$info.update(
"<%=
escape_javascript(
render(
partial: 'shared/info'
)
)
%>"
);
$info.show();
Hope it helps.