You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asciinema.org/app/helpers/application_helper.rb

39 lines
609 B
Ruby

module ApplicationHelper
def page_title
title = "ascii.io"
if @title
title = "#{@title} - #{title}"
end
title
end
def twitter_auth_path
"/auth/twitter"
end
def github_auth_path
"/auth/github"
end
13 years ago
def markdown(&block)
text = capture(&block)
MKD_RENDERER.render(capture(&block)).html_safe
end
def indented(string, width)
string.lines.map { |l| "#{' ' * width}#{l}" }.join('')
end
def category_link(text, url, name)
opts = {}
if name == @current_category
opts[:class] = 'active'
end
link_to text, url, opts
end
end