[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

validatoin image filed

misiek

3/8/2006 7:21:00 PM

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' %><br>
<%= text_area 'image', 'description', "cols" => 30,"rows" => 6
%>Description<br>
<%= 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
1 Answer

Andreas S.

3/8/2006 7:27:00 PM

0

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

Please ask this on the Rails mailing list.

--
Posted via http://www.ruby-....