0
나는 Devise와 Netzke 보석을 사용하고 있습니다. 내 레일 버전은 내가 netzke 구성 요소의 유증 도우미 (CURRENT_USER)에 액세스 할 3.1.1netzke에서 도우미를 어떻게 사용할 수 있습니까?
입니다.
하지만하지 모델이나 전망이다. 그것은 rails_root에서/응용 프로그램/컴포넌트/some_component.rb
어떻게 도우미 메서드 호출 할 수 있습니다? 감사. 보기에 내 코드가있다
....
# app/component/note_grid.rb
class NoteGrid < Netzke::Basepack::GridPanel
js_property :title, "Note"
model "Note"
def configuration
super.merge(
# I want to call helper method here.
:strong_default_attrs => {:user_id => current_user.id},
:columns => [{:name => :updated_at, :header => "Date - Time", :format => "d M Y - h:i A", :width => 200}, :description],
:add_form_config => {:items => [:description]},
:edit_form_config => {:items => [:description]}
)
end
end
# app/views/main/index.html.erb
<%= netzke :main_container, :class_name => "NoteGrid" %>
이 메소드는 더 이상 ' Netzke :: Core' 모듈을 어떻게 해결할 수 있습니까? netzke_demo에서'current_user'는'Application' 구성 요소에 정의되어 있습니다. 나는 똑같이 할 수 있었다. 하지만 내 모든 구성 요소에서'current_user' 도우미를 정의해야합니까? 이것이 현재 가장 좋은 접근 방법이라면 간단히 모듈을 포함시킬 수 있습니다. – nathanvda
Netzke :: Base.controller 사용 – mxgrn