diff options
author | Lukas Matt <lukas@zauberstuhl.de> | 2014-03-23 00:01:34 +0400 |
---|---|---|
committer | Lukas Matt <lukas@zauberstuhl.de> | 2014-05-15 15:23:43 +0400 |
commit | 6f21ccda064f749a7feca01224a7d91445ccc91b (patch) | |
tree | 0e36293c9036eeed79a0bd88a5da79020b71ff60 | |
parent | 26d0c81dae88370b5efd1d10a813eb157eb580ab (diff) |
Using case instead of equal
-rw-r--r-- | app/helpers/report_helper.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/helpers/report_helper.rb b/app/helpers/report_helper.rb index 91b94e49f..3d8ee929b 100644 --- a/app/helpers/report_helper.rb +++ b/app/helpers/report_helper.rb @@ -4,10 +4,11 @@ module ReportHelper def report_content(id, type) - if type.eql? "post" - raw t('report.post_label', title: link_to(post_page_title(Post.find_by_id(id)), post_path(id))) - elsif type.eql? "comment" - raw t('report.comment_label', data: comment_message(Comment.find_by_id(id))) + raw case type + when 'post' + t('report.post_label', title: link_to(post_page_title(Post.find_by_id(id)), post_path(id))) + when 'comment' + t('report.comment_label', data: comment_message(Comment.find_by_id(id))) end end end |