# Error tu display image

**URL:** <https://www.ruby-forum.com/t/error-tu-display-image/89560>\
**Category:** Rails\
**Created:** [March 21, 2007, 10:00am UTC](https://www.ruby-forum.com/t/error-tu-display-image/89560 "2007-03-21T10:00:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hasana](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/d78d45/32.png) [@hasana](https://www.ruby-forum.com/u/hasana)\
**Post date:** [March 21, 2007, 10:00am UTC](https://www.ruby-forum.com/t/error-tu-display-image/89560/1 "2007-03-21T10:00:43Z")

</div>

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…
