Skip to content

Instantly share code, notes, and snippets.

  1. Check if a page variable has been defined
    1. Set variables in a page (page.html.haml) at the very biginning of the file:

      ---
      variable: value
      variable2: value 2
      ---
# Original method
#def process(input)
# if input == 'q'
# puts 'Goodbye'
# elsif input == 'tweet'
# puts 'tweeting'
# elsif input == 'dm'
# puts 'direct messaging'
# elsif input == 'help'
# config/initializers/logger_customizations.rb
# Production-only monkeypatches to make our logs awesome
# Monkeypatch 1
# Don't log common poller-style requests, they are just noise
class CustomLogger < Rails::Rack::Logger
def initialize(app, opts = {})
@app = app
@opts = opts
@opts[:silenced] ||= []