Unbalanced brackets error

I’m getting unbalanced brackets and illegal nesting errors with this
line of code:

%html{ :lang => ‘en’, ‘xml:lang’ => ‘en’, :xmlns =>
http://www.w3.org/1999/xhtml’ }
%head
%script{:type => “text/javascript”
$(document).ready(function() {
<%= yield :javascripts %>
}});
%meta{“http-equiv” => “content-type”, :content =>
“text/html;charset=UTF-8”}

Any suggestions? thanks.

This gives me illegal nesting within plain text:

%head
%script{:type => “text/javascript”}
$(document).ready(function() {
<%= yield :javascripts %>
});
%meta{“http-equiv” => “content-type”, :content =>
“text/html;charset=UTF-8”}

Nevermind, I figured it out.

Since you didn’t say what the problem was, I’ll take a shot at it.

It looks like HAML to me. If it is, it looks like you should use
the :javascript filter instead of trying to build a tag using
%script.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs