Displaying 2 results from an estimated 2 matches for "photo_for".
2008 Jan 24
1
Uploading files: wrong number of arguments (1 for 0)
...ot;filename"].blank?
@user = @account.users.build(params[:user])
if @account.save
...
else
render :action => "new"
end
end
Here is my model file:
class Account < ActiveRecord::Base
has_many :agents
has_many :users
has_one :photo, :as => :photo_for
validates_associated :photo, :if => :has_photo?
end
If I include puts params[:photo].inspect in the controller it does show
me there is a datastream there
-----
{"filename"=>#<ActionController::UploadedStringIO:0x2519cc4>}
Thanks for the help.
--
Posted via http://www.r...
2007 Dec 13
4
Attachment_fu problems on updates
...ams[:member])
....
end
end
Here is the Member model code:
-------------------------
class Member < ActiveRecord::Base
validates_presence_of :first_name, :last_name, :city, :region,
:region_code
has_many :groups, :through => :group_members
has_one :photo, :as => "photo_for"
validates_associated :photo
end
Here is the file_system_backend (where the error is occurring):
-----------------------------------------------
def full_filename(thumbnail = nil)
file_system_path = (thumbnail ? thumbnail_class :
self).attachment_options[:path_prefix].to_s
#here...