retrospring/app/helpers/social_helper.rb
2023-11-26 17:12:56 +01:00

21 lines
576 B
Ruby

# frozen_string_literal: true
module SocialHelper
include SocialHelper::TwitterMethods
include SocialHelper::TumblrMethods
include SocialHelper::TelegramMethods
def answer_share_url(answer)
answer_url(
id: answer.id,
username: answer.user.screen_name,
host: APP_CONFIG["hostname"],
protocol: (APP_CONFIG["https"] ? :https : :http),
)
end
def answer_copy_content(answer)
# copy content template: "question - answer [link]"
"#{answer.question.content} - #{answer.content} [#{answer_share_url(answer)}]"
end
end