Alex Young
11/13/2007 11:19:00 AM
Nadeesha Meththananda wrote:
<snip>
> ######### the model ###################
>
> class Post < ActiveRecord::Base
> def self.save(person)
> f = File.new("pictures/#{person['name']}/picture.jpg", "wb")
> f.write params[:picture].read
You'll probably get a better response over on the Rails list, but I
suspect this is your problem - the params hash isn't in scope in
ActiveRecord descendants. You should have more luck if you define your
method as def self.save(person, picture), and call it in you controller
as Post.save(params[:person], params[:picture]).
<snip>
> SO IF SOMEBODY KNOW HOW TO OVER COME THIS PROBLEM PLS REPLY
NO NEED TO SHOUT! :-)
--
Alex