7 Must-Reads about JavaScript with Ruby on Rails

JavaScript is a very popular programming language used in lots of projects, also those in Ruby on Rails. It's a good idea to get to know both od these.
Whether you are an experienced web developer or just getting your feet wet in the wonderful "ocean" of web development and programming, these handy resources can help you improve your skills in JavaScript and hopefully teach you a few new tricks along the way.
Resources on JavaScript with Ruby on Rails
1. Working With JavaScript in Rails
Designed for beginners, this guide covers, among others:
- the basics of Ajax,
- JavaScript functionality,
- how built-in helpers work,
- the turbolinks gem,
- how to handle Ajax on the server side.
This resource is a compilation from various contributors over many years. It's a living document and everyone is welcome to add their own ideas and experiences.
2. Unobtrusive JavaScript
This blog post is a great resource for beginner and intermediate web developers. JavaScript enhances your website in many ways, but for various reasons, some people don't like to have it running, so they disable JavaScript support. This prevents them from seeing your content the way it was meant to be seen.
With unobtrusive JavaScript techniques, all the content on your site remains accessible even when JavaScript support is disabled. Unobtrusive JS techniques also greatly enhance your code maintainability and allow better separation of behaviour from markup. Learn more about this from Andrew Chalkley and the Treehouse team.
3. Page Specific JavaScript in Rails
Page specific JavaScript allows you to isolate code to only run on pages you specify. For example, if you have two pages, but only want the alert box to appear on one page, you can. Add a few snippets of code on a certain page and the alert box will only show up there and nowhere else. If you are a beginner, you might have a problem understanding all this at first, but once you reach the intermediate level, adding this code is simple as can be. Brandon Hilkert shows you how.
4. The Detailed Guide on How Ajax Works With Ruby on Rails
With this tutorial by the Tealeaf Academy, beginner web developers learn how to significantly enhance navigation for a smoother user experience. The guide takes you step by step through a textbook example on how it works.
5. How to Debug Ajax in Rails
Tom Caflisch is a Ruby on Rails code mentor. With this tutorial, he teaches new web developers how to debug Ajax in Rails apps. This is an approach the guru uses in his own applications, so you know it works.
6. Asset Pipeline
This guide covers everything beginner web developers need to know about the asset pipeline such as:
- what it is and what it does,
- how to organize application assets properly,
- how to package assets with a gem,
- the benefits of the asset pipeline,
- how to add a preprocessor.
This resource is authored by various Rail Guide contributors.
7. Rails With No JS Framework
Beginner and intermediate web developers find out that not all apps need Ember or Angular. Learn the benefits and drawbacks of a framework and how to organize code. Christian Blavier tells you everything you need to know about how it works and takes you through easy-to-follow steps with plenty of examples along the way.
These are just a few resources to help with your web development projects. Try one or try them all and, before long, you will see progress.
At Netguru, many of our developers work with Ember.JS framework - if you're also using it, learn about Ember Run Loop from this ebook - it will help streamline your work with the code. Enjoy!