We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2 Unobtrusive JavaScript
paintIt = (element, backgroundColor, textColor) -> element.style.backgroundColor = backgroundColor if textColor? element.style.color = textColor
And then on our page:
painit is not getting called. paintit needs to be delcared as @PaintIt After that its getting called. My rails ver - 4.2.3
The text was updated successfully, but these errors were encountered:
Fix paintIt method in JavaScript guides [ci skip]
c835094
- Changed "paintIt" to "@PaintIt" so that it can be called in an on click handler. - Closes rails#22568
No branches or pull requests
Information about how to call coffee script functions from event handler is not working as told in the guide.
2 Unobtrusive JavaScript
paintIt = (element, backgroundColor, textColor) ->
element.style.backgroundColor = backgroundColor
if textColor?
element.style.color = textColor
And then on our page:
Paint it red
painit is not getting called.
paintit needs to be delcared as @PaintIt
After that its getting called.
My rails ver - 4.2.3
The text was updated successfully, but these errors were encountered: