how to write the code in model

Lost Warrior
2008-07-19T15:07:14Z

hi i am a beginner for rails.how to write this in a model   and how
to call in a controller
   def upload
    @image=Image.new
    @image.filename=params[:image][:uploaded_data].original_filename
    @image.content_type=params[:image][:uploaded_data].content_type
    @image.siz=params[:image][:uploaded_data].size
    @image.user_id=params[:image][:patient_id]
    @image.save
   end
--
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---