Gem 用了 Rails Cells,如果引用 help 里的方法?

stephen · 2012年01月16日 · 最后由 xdite 回复于 2012年02月04日 · 4201 次阅读

用了 Rails Cells,如果引用 help 里的方法? 查文档,找不到类似的信息!

include...前台的 view 只是默认的 include。

@bony include ApplicationHelp??还是错误

你用到那个 help,就 include 那个 helper..

看 ruby-china 的 cell 代码

rails 会自动载入所有的 helper. 你直接用就好了。去了解了解 rails 的加载方式。;)


class CommonCell < Cell::Rails
  helper Handicraft::Helper
  helper :open_graph
  helper :avatar
  helper :posts
  helper :users
  helper :tags
  helper :techbang_sso
  helper :advertises

  include ActionController::Cookies
  helper HasMobile::ViewHelper

需要 登录 后方可回复, 如果你还没有账号请 注册新账号