Ruby on Rails Saturday, May 3, 2014

Hi all,

I'm starting with Ajax but I have a issue, should be a noobie issue but it makes me crazy hehe. Could anyone tell me what's going on?.

I'm following this guide http://guides.rubyonrails.org/working_with_javascript_in_rails.html, and with the following code my application does not recognize the action.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <title>Hola Mundo con AJAX, version 2</title>

  <script>

      paintIt = (element, backgroundColor, textColor) ->       SHOW ERROS LIKE 'unresolved variable or type element'
              element.style.backgroundColor = backgroundColor
      if textColor?
              element.style.color = textColor

  </script>

</head>
<body><a href="#" onclick="paintIt(this, '#990000')">Paint it red</a></body>
</html>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3bac38e2-4346-4f15-b04e-0fa4ef945979%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment