Sathiya wrote:> how the form validation in rubyonrails and how to retrieve the image
> from database and how to upload the image in rubyon rails
through model u can validate.using moel valaidations
ex:validates_presence_of :name,:message=>"Required fields cannot be left
blank"
upload file by using in html
<%= file_column_field "manufacturer_document", "document"
,:class=>''txt_box_sall''%>
manufacturer_document ---- it denotes model name
document ------ denotes field name in db
in controller the code is
@manufacturer_document =
ManufacturerDocument.new(params[:manufacturer_document])
@manufacturer_document.save
now your doubt clears!
--
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
-~----------~----~----~----~------~----~------~--~---