I downloaded rails.js
here and included it in views/layouts/application.html.erb
along with jQuery:
<%= javascript_include_tag 'jquery-1.4.4.min.js', 'rails.js' %>
<%= csrf_meta_tag %>
However, on page load I got the following error in browser's console 开发者_如何学Go(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 ?
I would highly recommend the jquery-rails gem. once you have it installed, a simple rails g jquery:install
and everything is taken care of for you properly.
精彩评论