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

32 lines
624 B
Ruby

module ApplicationHelper
def twitter_auth_path
"/auth/twitter"
end
def github_auth_path
"/auth/github"
end
13 years ago
def default_avatar_url
image_path "default_avatar.png"
end
def avatar_img(user)
nickname = "~#{user.nickname}"
13 years ago
image_tag user.avatar_url || default_avatar_url,
:title => nickname, :alt => nickname, :class => "avatar"
13 years ago
end
def markdown(&block)
text = capture(&block)
if defined? RedCarpet
MKD_RENDERER.render(capture(&block)).html_safe
elsif defined? Kramdown
Kramdown::Document.new(text).to_html.html_safe
else
text
end
end
end