class Post < ActiveRecord::Base def self.save(person) f = File.new("pictures/#{person['name']}/picture.jpg", "wb") f.write params[:picture].read f.close end
in the uploading it gives a error like this
undefined local variable or method `params' for Post:Class
The message is pretty clear: params doesn't exist here. It only exists inside an instance of controller. You need to pass params through to the save method (which you're already doing, but not using it for some reason.).
Fred