Gem doesn't work with rails-ujs
psmir opened this issue · comments
psmir commented
When I use rails-ujs instead of jquery_ujs and try to remove nested fields by remove_nested_fields_link, I get the following error:
TypeError: $.rails.allowAction is not a function
Nico Ritsche commented
Check this issue here: #92 Possibly you can define $.rails.allowAction somewhere and make it return true as a hack. But haven't tried.
Sanjay Sharma commented
Add gem 'jquery-rails' in your Gemfile.
In your application.js remove //= require rails-ujs and add //= require jquery_ujs. This worked for me in rails 5.2.2
Pierre Olivier Martel commented
I defined $.rails.allowAction = function() { return true }
and it fixed the issue when migrating to Rails UJS.