2010-06-07 74 views
1

我有一個CopiesHelper模塊,其方法爲cc找不到幫手方法

在我ApplicationController,我有

helper :all 
helper_method :cC#just tried putting this in recently 

如果在我的控制器的一個又一個,我嘗試使用cc方法,我得到

undefined method 'cc' for #<OtherController:0xblublublublub> 

我錯過了一步嗎?

回答

0

如果你想用你的CopiesHelper在你的控制器之一,簡單地做:

{} APP_DIR /app/controllers/your_controller.rb

class YourController < ApplicationController 
    include CopiesHelper 

如果你想使用您的應用的每個控制器中的CopiesHelper只需執行以下操作:

in {app_dir} /app/controllers/application_controller.rb

class ApplicationController < ActionController::Base 
    include CopiesHelper 
0

那麼,好像幫助者通常不是在控制器中使用!