Using Javascript To Reverse A String

Strings can be split using three built-in functions:

  • Split() is a method that splits a String object into an array
  • Reverse() is a method that reverses the array
  • Join() is a method that joins an array into a string

function reverseString(str) {
    return str.split("").reverse().join("");
}
reverseString("hello");

guide
Font Awesome 5 SVG icons use javascript to find <i> tags with an icon class and replaces them with an <svg> tag. Turbolinks online displays these icons on initial page load and/or refresh, however when following a link, Turbolinks reloads the page and not the icons. This guide assumes that you have already loaded font awesome into your project using your preferred method. For what its worth, this guide uses the font awesome CDN more
guide
The ability to like or favorite posts is very common on websites. This guide will show you how to add this functionality to your Rails 5 application without adding unnecessary bloat from gems. This guide assumes that you have already implemented posts (or similar) and users to your application and will not cover these steps. Let's go over some design considerations before we begin. While everyone can view a post, only authenticated users can like posts by clicking a link or icon.  We're keeping it positive by just tracking likes.more