Three Things I Learned This Week - October 21 2016

  • Rails strips out the ‘target’ attribute on an anchor tag as part of its sanitation. To allow ‘target’, you can whitelist it, but be sure to then also whitelist ‘href’. For example:
<%= sanitize html.body, attributes: %w(href target) %>
  • Chrome, as of version 52, requires a secure (https) connection to use the geolocation API.
  • git has a ‘-‘ alias to refer to the previous branch, making branch navigation and merging quick and easy. For example: (on master branch)
  git checkout feature_branch
  git checkout - # Back on master branch
  git checkout - # Back on feature_branch