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
를 다시 시작 commontator 초기화 파일을 변경해야
current_registered_user
입니다. 해당 클래스의 코드를 표시하는 것이 도움이됩니다. – rossta위의 특정 방법을 추가했습니다. –