ruby - Undefined method `validates_attachment_content_type' in Rails model class -
using rails 2.3.* (legacy project, adding features) , i'm getting error paperclip plugin. i'm not sure why telling me method undefined. paperclip 2.4.5 installed when check gems using gem list. error is:
undefined method `validates_attachment_content_type' #<class:0x107d4e1c8>
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'
and here picture model class (picture.rb): require "paperclip"
class picture < activerecord::base validates_attachment_content_type :photo, :content_type => ['image/jpeg', 'image/png', 'image/pjpeg', 'image/gif','image/bmp'] validates_attachment_presence :photo, :message => 'is required' belongs_to :incident belongs_to :user has_attached_file :photo, :styles => { :thumb => "50x50#", :small => "150x150>", :large => "800x800>", :printable => "350x350" } end
Comments
Post a Comment