views:

282

answers:

2

I've installed paperclip to my project as plugin using ruby script/plugin install http://github.com/thoughtbot/paperclip.git

Model:

class Company < ActiveRecord::Base
   has_attached_file :logo, :styles => { :large => "300x300>", :medium => "100x100>", :thumb => "50x50>" }
   validates_attachment_content_type :logo, :content_type => image/jpeg, :message => "Incorrect logo file type!"
   validates_attachment_size :log, :max => 200, :message => "big file" 
end

But controller methods returns: NoMethodError in CompaniesController#new undefined method `has_attached_file' for #

If i try to "require 'paperclip' " before model class, returned: MissingSourceFile in CompaniesController#new no such file to load -- paperclip

What is the problem?

+1  A: 

The paperclip Railscast is a great source to start playing with paperclip, try following those steps and let us know if your problem persists.

jpemberthy
A: 

Try installing it as a gem (sudo gem install paperclip) and then using 'require paperclip' at the beginning of your model file.

Kyle