-1

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

#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.

4

1 回答 1

0

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

config.active_record.whitelist_attributes = true

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

于 2012-09-07T07:28:00.847 回答