From 08a1968fd2e5c003361b715c2e412a5858024855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Thu, 24 Sep 2015 12:38:05 +0200 Subject: [PATCH] adds mailer helper --- app/helpers/mailer_helper.rb | 8 ++++++++ app/mailers/mailer.rb | 1 + 2 files changed, 9 insertions(+) create mode 100644 app/helpers/mailer_helper.rb diff --git a/app/helpers/mailer_helper.rb b/app/helpers/mailer_helper.rb new file mode 100644 index 000000000..ad6f042af --- /dev/null +++ b/app/helpers/mailer_helper.rb @@ -0,0 +1,8 @@ +module MailerHelper + + def commentable_url(commentable) + return debate_url(commentable) if commentable.is_a?(Debate) + return proposal_url(commentable) if commentable.is_a?(Proposal) + end + +end \ No newline at end of file diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index 15a8eb54a..b7efb327e 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -1,5 +1,6 @@ class Mailer < ApplicationMailer helper :text_with_links + helper :mailer def comment(comment) @comment = comment