Why doesn't Rails 3 work with jQuery 1.4.4?

I downloaded rails.js here and included it in views/layouts/application.html.erbalong with jQuery:

<%= javascript_include_tag 'jquery-1.4.4.min.js', 'rails.js' %>
<%= csrf_meta_tag %>

However, when loading the page I received the following error in the browser console (I use the latest Firefox):

Error: syntax error
Source File: http://localhost:3000/javascripts/rails.js?1292414064
Line: 6
Source Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

What am I doing wrong?

+3
source share
1 answer

I highly recommend jquery-rails gem. as soon as you install it, simply rails g jquery:installand everything will take care of you properly.

+4
source

Source: https://habr.com/ru/post/1780416/


All Articles