Permalink
Browse files

When people have issues with click handlers have them follow the steps

Close #495
  • Loading branch information...
MicFin committed Aug 28, 2017
1 parent fe9e500 commit d639d5383076701b83f1c67ba4d9f25e63e3d5fc
Showing with 12 additions and 0 deletions.
  1. +12 −0 tips.md
12 tips.md
@@ -17,3 +17,15 @@
if real data is not available. For example, if you’re trying to figure out
how to change some text when the game is over but you haven’t solved the
win/lose game logic, you can create a button to simulate that until then.

- _If your success/failure methods aren't working, it's likely that you're not getting to the point where you're making an ajax call._
1. Create my HTML element.
2. Create a click handler attached to that element.
2a. Have the click handpreler console.log('hello') AND DO NOTHING ELSE.
3. Verify that any data I want to pass to my api call is the data I expect it to be when I have it in the click handler. (`Using console.log()`)
4. Add an ajax call to my click handler.
5. Verify that the backend server is doing what I expect when I make the ajax call. Check the server log and/or the rails console.
6. Have the success function console.log('success!!') AND DO NOTHING ELSE.
7. Have the success function add "Hello" to the HTML using jQuery
8. Have the success function console.log the data I get back from the server.
9. Add that data to the HTML using jQuery or handlebars. (or do something else, as appropriate.)

0 comments on commit d639d53

Please sign in to comment.