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

stephen · January 16, 2012 · Last by xdite replied at February 04, 2012 · 4202 hits

用了 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

You need to Sign in before reply, if you don't have an account, please Sign up first.