2014-10-12 2 views
0

내가 & commontator 보석정의되지 않은 메서드`CURRENT_USER '(commontator + 유증)

을 고안 사용하고 내가 모르는 것 "CURRENT_USER"에 대한 오류 때 시도에 "쇼"제품!

undefined method `current_user' for #<ProductsController:0xd09600c> 

사용자 모델

class RegisteredUser < ActiveRecord::Base 
    # Include default devise modules. Others available are: 
    # :confirmable, :lockable, :timeoutable and :omniauthable 
    devise :database_authenticatable, :registerable, 
     :recoverable, :rememberable, :trackable, :validatable 

    # Registered user can comment on a product 
    acts_as_commontator 
end 

제품 모델

class Product < ActiveRecord::Base 
    # Product can be commented on 
    acts_as_commontable 
end 

난 모델의 이름을 기반으로 ProductsController가

class ProductsController < ApplicationController 
    def show 
    commontator_thread_show(@product) 
    end 
end 
+0

를 다시 시작 commontator 초기화 파일을 변경해야 current_registered_user입니다. 해당 클래스의 코드를 표시하는 것이 도움이됩니다. – rossta

+0

위의 특정 방법을 추가했습니다. –

답변

0

유증 도우미에서 쇼 메소드를 호출

,

는 그래서하지

current_user 당신이 메시지에서 볼 수 있듯이, 오류가`ProductsController`에서 오는 서버