Post concise notes that can be used for quick reference here!

Google Analytics with Rails 5 and Turbolinks

Go ( to Admin > Property > Tracking Info > Tracking Code to get your 'UA-xxxxxxx-x' apps/views/application/_analytics.html.erb ```javascript <% if Rails.env.p...

  • Updated almost 2 years ago by vince
Authentication in Rails

If you want to roll out your own authentication in Rails this should get you going /app/controllers/concerns/authenticate.rb ```ruby module Authenticate extend ActiveSupport::Concern protected ...

  • Updated almost 2 years ago by vince
Using Rouge with Redcarpet

Gemfile ruby gem 'redcarpet' gem 'rouge' application_helper.rb ```ruby def markdown(text) options = { filterhtml: true, hardwrap: true } extensions = { autolink: true...

  • Updated almost 2 years ago by vince
Running Rake tasks

An example of a rake task that skips updating the updated_at column. To run this rake task type: rake maintenance:move_topics RAILS_ENV=production /lib/tasks/maintenance.rake ```ruby namespace :mai...

  • Updated almost 2 years ago by vince
Postgres and Heroku backups

Dump To dump and download a Heroku Postgres db heroku pg:backups:capture heroku pg:backups:download To dump directly from your Heroku database pg_dump --host=<host_name> --port=<port> --username=<u...

  • Updated about 2 years ago by vince