Saturday, 30 March 2019

JQuery Match Height Not Working on Rails 5.2

I'm getting the following error after trying to install Jquery Match Height on my Rails app.

enter image description here

I've tried using the Match Height Gem, simply copy-pasting the entire script into my application.js, and (currently) a CDN include on my application.html.erb:

 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.matchHeight/0.7.2/jquery.matchHeight.js" type="text/javascript"></script>

The same errors are generated regardless. I have these jquery-related gems installed:

gem 'jquery-rails'
gem 'jquery-ui-rails'

Here's how I'm trying to use Match Height:

<script>
  $(document).ready(function() {
    $('.card-img-top').matchHeight();
    $('.card-title').matchHeight();
    $('.card-text').matchHeight();
    $('.card-footer').matchHeight();
  });
</script>

Can anyone see what I'm doing wrong?



from JQuery Match Height Not Working on Rails 5.2

No comments:

Post a Comment