在rails 4

时间:2017-06-05 12:12:25

标签: ruby-on-rails ruby ruby-on-rails-4 rubygems camaleon

我有一个名为cama_current_user的方法,由宝石Camaleon CMS提供,它在宝石内部使用。现在我在我的应用程序中使用这个Gem,我需要覆盖方法`cama_current_user'通过做这样的事情,

  def cama_current_user
    @current_user
  end

我已在ApplicationControllerApplicationHelper中添加了此方法,甚至添加了这样的新模块,

module CamaleonCms::SessionHelper
  def cama_current_user
    @current_user
  end
end

但这些方法在执行期间都没有调用。那么如何覆盖Gem提供的现有方法定义。

任何建议都将不胜感激。谢谢!!

0 个答案:

没有答案
相关问题