From: misiek Date: 2006-03-09T04:23:41+09:00 Subject: validatoin image filed 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