Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jQuery 3 causing errors in Rails admin #2838

Closed
MatthiasRMS opened this issue Feb 23, 2017 · 3 comments
Closed

jQuery 3 causing errors in Rails admin #2838

MatthiasRMS opened this issue Feb 23, 2017 · 3 comments

Comments

@MatthiasRMS
Copy link

A few things where broken in Rails admin (multiselect for associations, for example), and after opening the browser's console, there was this error:

Cannot read property 'push' of undefined
RailsAdmin is not defined

After doing some quick research, it turns out that since Rails Admin uses jQuery 3, this error appeared.

I had to copy all of the gem's javascript folder to my app's assets, and change:
//= require 'jquery'

to:

//= require 'jquery2'

in rails_admin.js.

It's definitely not a good solution, but the only one I've found so far. I can't imagine being the only one with this issue. Has this been addressed somewhere else ? I couldn't find anything related yet.

@jklimke
Copy link
Contributor

jklimke commented Mar 7, 2017

I propose a 'solution' / fix for first error "Cannot read property 'push' of undefined" in
#2842

@MatthiasRMS
Copy link
Author

Thanks @jklimke , but I'm trying to find a solution without adding quick fixes or snippets of code which would much likely break with upcoming releases. Reverting to jQuery 2 doesn't break anything. See:
#2839

@mshibuya
Copy link
Member

Don't you use jquery-rails?
https://github.com/rails/jquery-rails#installation
The name jquery is for jQuery 1.x, if you need jQuery 3.x you should require jquery3 in your application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants