Credentials or env
A simple helper that selects some configuration from credentials or environment variable
# frozen_string_literal: true module Credentials # Returns credentials or env # OBS: Does not support nested credentials
Curated ago by
@pedroaugustorduarte
Rendering Markdown with Multiple Modes
Sometimes when I'm working with Markdown in a Rails app, I'll be using different sets of redcarpet flags for different types of content. For example, I have images and links turned on for blog posts, but turned off for comments. Keeping track of all the variations can be difficult. I...
module MarkdownHelper def render_markdown(content, mode) sanitize(MarkdownRenderer.new(content, mode).render) end end
Curated ago by
@jeremysmithco