this regcounselor_controller
def new
@regcounselor = Regcounselor.new
end
def create
@regcounselor = Regcounselor.new(params[:regcounselor])
if @regcounselor.save
flash[:notice] = ''Regcounselor was successfully
created.''
redirect_to :action => ''list''
else
render :action => ''new''
end
end
def pictureimg=(picture_field)
return if picture_field.blank?
self.content_type = picture_field.content_type.chomp
self.picture = picture_field.read
end
def image
@regcounselor = Regcounselor.find(params[:id])
send_data @regcounselor.picture, :filename => "photo.jpg",?
:type => @regcounselor.content_type, :disposition => "inline"
end
when i submit the file new.rhtml this error come out..
undefined method `pictureimg='' for #<Regcounselor:0x474e9ac>
i think this error happen because this code
def create
@regcounselor = Regcounselor.new(params[:regcounselor])
if @regcounselor.save
flash[:notice] = ''Regcounselor was successfully
created.''
redirect_to :action => ''list''
else
render :action => ''new''
end
end
but i don''t know how to fix this problem.
please help me..
--
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
-~----------~----~----~----~------~----~------~--~---