Embedding Ruby In JavaScript
November 19, 2013
This morning I was able to get almost all the way through Chapter 11 of the Rails Tutorial, but I had to stop at section 11.3 because I ran out of time. I’m glad that I made good progress on the tutorial, but I didn’t give myself a chance to work on my own rails app this morning. That is something that I want to do everyday though, so I should try to find some time to do that later today. I just want to make sure I’m in the habit of making my own things and not just blindly reading tutorial after tutorial with nothing to show for it besides a lot of blog posts.
Some of the things that I learned today:
has_many through- unobtrusive JavaScript
xhrmethod - for testing ajax
I did think it was interesting that we are embedding ruby into our javascript code. I ignorantly assumed this was a bad thing with the legacy php code I’ve been working with, just because it was making the code really hard to read and to segment into their own files. Now I want to read more about what the best practices are with embedding ruby/php code into your javascript.