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.
25 lines
519 B
Ruby
25 lines
519 B
Ruby
module ApplicationHelper
|
|
def twitter_auth_path
|
|
"/auth/twitter"
|
|
end
|
|
|
|
def github_auth_path
|
|
"/auth/github"
|
|
end
|
|
|
|
def default_avatar_url
|
|
image_path "default_avatar.png"
|
|
end
|
|
|
|
def avatar_img(user)
|
|
nickname = "~#{user.nickname}"
|
|
image_tag user.avatar_url || default_avatar_url,
|
|
:title => nickname, :alt => nickname, :class => "avatar"
|
|
end
|
|
|
|
def markdown(&block)
|
|
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)
|
|
markdown.render(capture(&block)).html_safe
|
|
end
|
|
end
|