<!DOCTYPE html> <html> <head> <title><%= @title %></title> <%= csrf_meta_tag %> <%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js", "jquery.rails.js" %> <script type="text/javascript"> ...app/views/layouts/application.html.erb:7: syntax error, unexpected '','', expecting '')'' ...bs/jquery/1.6.2/jquery.min.js", "jquery.rails.js" ... ^ Extracted source (around line #7): 4: <title><%= @title %></title> 5: <%= csrf_meta_tag %> 6: <%= javascript_include_tag 7: "http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js", "jquery.rails.js" 8: %> 9: 10: <script type="text/javascript"> As far as I can tell, that is the same syntax used at the end of this railscast: http://railscasts.com/episodes/205-unobtrusive-javascript -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I guess I can always just do this: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script><script type="text/javascript", src="jquery.rails.js" ></script> but I''m still wondering why I got the error. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 10 Aug 2011, at 19:15, 7stud -- wrote:> ...app/views/layouts/application.html.erb:7: syntax error, unexpected > '','', expecting '')'' > ...bs/jquery/1.6.2/jquery.min.js", "jquery.rails.js" > ... ^ > Extracted source (around line #7): > > 4: <title><%= @title %></title> > 5: <%= csrf_meta_tag %> > 6: <%= javascript_include_tag > 7: "http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js", > "jquery.rails.js" > 8: %> > 9: > 10: <script type="text/javascript">Ruby looks at the code in line 6, and thinks you''re just calling javascript_include_tag without any arguments. It then tries to parse line 7 as a new statement, but doesn''t know what to do with a string followed by a comma. If you put the first argument to javascript_include_tag on the same line (i.e. combine lines 6 and 7), then Ruby will know you''re listing arguments to javascrip_include_tag, and it''ll work. Chris -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Chris M. wrote in post #1016050:> > If you put the first argument to javascript_include_tag on the same line > (i.e. combine lines 6 and 7), then Ruby will know you''re listing > arguments to javascrip_include_tag, and it''ll work. >Thanks. That means I can do this: <% javascript_include_tag( "http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js", "jquery.rails.js") %> -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.