【问题标题】:Growl notifications from delayed job来自延迟工作的咆哮通知
【发布时间】:2012-08-31 18:49:11
【问题描述】:

我刚刚打破了我现有的从 delay_job 获取咆哮式通知的方式,打开别人的 gem 并到处乱窜并没有让我到任何地方。所以我想知道:从后台任务获取通知的明智方法是什么。目前我正在使用 gritter_notices 和这样的 ruby​​ 类(但我已经做了一些事情来阻止它工作......而且文档不是我的母语......)

#User.rb

has_gritter_notices



class DoThing

  def run_thing(books, template, client, user)
     # some code


     User.find(user).notice "<a href='/archives' target='_blank'>View Archive</a>", :level => :notice, :sticky => true, :title => "Things generated." 

  end

handle_asynchronously :run_thing

end

ps 我得到的错误是ActiveRecord::RecordInvalid: Validation failed: Text can't be blank

【问题讨论】:

    标签: ruby-on-rails delayed-job gritter


    【解决方案1】:

    哦,别理我。我打开了 whitelist_attributes:

    config.active_record.whitelist_attributes = true
    

    并且 gem 没有将其属性与attr_accessible 列入白名单。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-26
      • 1970-01-01
      • 2015-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-21
      • 1970-01-01
      相关资源
      最近更新 更多