ActionView :: Template :: Error(未定义的局部变量或方法`check_public'

时间:2013-10-10 09:24:44

标签: ruby ruby-on-rails-3.2 actionmailer diaspora

我正在处理与电子邮件通知相关的diaspora *问题:

私人帖子:在电子邮件通知中显示链接(无文字)

公开发布:在电子邮件通知中显示摘要和链接

这是我对侨民的拉动请求*:https://github.com/diaspora/diaspora/pull/4508

链接到我的Github回购:https://github.com/railsgirls-generator-app/diaspora/tree/4266-remove-content-from-email-notifications

This行会出错:

ActionView::Template::Error (undefined local variable or method `check_public' for #<#<Class:0xd1e5638>:0xb5081bf4>):
1: <% ispublic = check_public(@notification.post) %>
2: <% if ispublic == true %>
3: <%= comment_message(@notification.comment, :process_newlines => true) %>
4: 
  app/views/notifier/comment_on_post.markerb:1:in `_app_views_notifier_comment_on_post_markerb__51526760__628881328'

如何解决此问题?

1 个答案:

答案 0 :(得分:0)

我只是猜测,因为我必须更好地了解代码库才能真正理解这个问题。

我能从中看到的一切:

  1. 您在邮件程序模板中呼叫check_public
  2. check_publicapp/helpers/notifier_helper.rb
  3. 中定义
  4. 引发错误,因为该方法未公开呈现
  5. 所以我想在NotifierHelper中包含CommentOnPost可以解决问题。