0
내 Rails 프로젝트에서 정의되지 않은 오류가 발생합니다. 이 방법은 플러그인 클립에 의해 사용됩니다. 아무도 내가 뭘 잘못하고 있다고 말할 수 있습니까? 여기에 내 사진 클래스의 시작이다 : 당신은 당신의 모델 attr_accessible
누락정의되지 않은 클립 방법
Extracted source (around line #122):
119: <%= link_to 'Printable', { :action => 'print', :id => @incident.id }, { :target => '_blank', :class => "button" } %>
120: <% if isviewable?(@incident) %>
121:
122: <%= link_to "Pictures (#{@incident.pictures.count})", incident_pictures_path(@incident), :class => "button" %>
123: <%= link_to "Suspects (#{@incident.suspects.count})", incident_suspects_path(@incident), :class => "button" %>
Application trace:
/usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.11/lib/active_record/base.rb:1998:in `method_missing'
/Users/grantmc/Dev/railsprojects/Police/app/models/picture.rb:5
/Users/grantmc/Dev/railsprojects/Police/app/views/incidents/show.html.erb:122:in `_run_erb_app47views47incidents47show46html46erb'
같은 그들에게
attr_accessor
에 명시 적으로 asign이 내 모델 photo'을? – grantmcconnaughey예, 모델에 attr_accesor : photo를 추가해야합니다. – sunny1304
불행히도이 코드 줄을 추가하면 똑같은 오류가 발생합니다. 오류 메시지는 validates_attachment_content_type 메소드를 인식하지 못하기 때문에 어떤 이유로 모델이 클립 클립을 볼 수 없다고 생각합니다. – grantmcconnaughey