Colin Law wrote: > On 20 July 2010 11:07, Hemant Bhargava <[email protected]> wrote: >> Hello all, >> >> How to give validation on a field which is not a database column. I mean >> i am having a file field(upload_resume) in my views. So i want to give >> validation on it that size should be less then 1mb. I tried >> self.upload_resume and params[:upload_resume] but both are not working. > > Are you trying to check the file size before or after the upload?
Hello Guys, Thanks for your replies. Yes i want to check the size of file before upload only. I mean first i am checking that file had valid attributes or not. If it has then upload it else dont. Currenly i am doing this in controllers but for cleaner code i want to do it in models with validations. > > Colin -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

