lanrion / weixin_rails_middleware

微信集成 ruby weixin_rails_middleware for integration weixin.
MIT License
408 stars 107 forks source link

如何在weixin_controller_decorator.rb文件以外使用reply方法 #46

Closed chenzhong closed 9 years ago

chenzhong commented 9 years ago

需要在weixin_controller_decorator.rb以外使用reply_news_message(articles)方法,是否只需要

include WeixinRailsMiddleware::ReplyWeixinMessageHelper 即可?

目前在 一个class中 include过,但还是找不到该方法


class Notify

  include WeixinRailsMiddleware::ReplyWeixinMessageHelper

  def self.send_shop_message(articles)
    reply_news_message(articles)
  end

end
lanrion commented 9 years ago

没有这样子做过,如果要,需要实现@weixin_adapter@weixin_public_account这两个属性。你可以试试。

chenzhong commented 9 years ago

OK, thanks!