Today I Learned
Rails’ Array#inquiry
makes checking string-like arrays easier (via Kasper Timm Hansen):
# instead of:
parts = [:feed, :description, :play, :play_later]
parts.include?(:description)
# with `inquiry`:
parts = [:feed, :description, :play, :play_later].inquiry
parts.description?
Rails’ truncate
helper accepts a block which is captured and displayed when the contents is truncated. (via Matt Swanson on Twitter)