# Validatoin image filed

**URL:** <https://www.ruby-forum.com/t/validatoin-image-filed/78670>\
**Category:** Ruby\
**Created:** [March 8, 2006, 8:26pm UTC](https://www.ruby-forum.com/t/validatoin-image-filed/78670 "2006-03-08T20:26:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![misiek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/76d3ee/32.png) [@misiek](https://www.ruby-forum.com/u/misiek)\
**Post date:** [March 8, 2006, 8:26pm UTC](https://www.ruby-forum.com/t/validatoin-image-filed/78670/1 "2006-03-08T20:26:05Z")

</div>

hi

I have problem to check the validation of the image field  
my form

\<%= form\_tag({:action=\>‘upload’, :id =\> @property.id }, :multipart =\>  
true )%\>  
\<%= file\_field ‘image’,‘name’ %\>  
  
\<%= text\_area ‘image’, ‘description’, “cols” =\> 30,“rows” =\> 6  
%\>Description  
  
\<%= submit\_tag “send” %\>  
\<%= end\_form\_tag %\>

image.rb  
validates\_presence\_of :name, :description

controller  
@image = Image.new(params[:image])

if !@image.valid?  
error = true  
end

if error  
flash[:error] = “some fields are empty”  
render :action =\>“view”  
else  
bleble ble  
end

tchecking the descriptoin is ok but not the name if the image because  
the @image.name keep a hash ‘#’ inside and its not empty

ho to do that

---

<div class="post-metadata">

**Author:** ![misiek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/76d3ee/32.png) [@misiek](https://www.ruby-forum.com/u/misiek)\
**Post date:** [March 8, 2006, 8:27pm UTC](https://www.ruby-forum.com/t/validatoin-image-filed/78670/2 "2006-03-08T20:27:06Z")

</div>

misiek wrote:

> hi
> 
> I have problem to check the validation of the image field  
> my form

Please ask this on the Rails mailing list.
