On Thu, Mar 5, 2009 at 6:34 AM, srikanth <[email protected]> wrote:

>
> Hi
> In my application i want to validate the fields of perticular views.
> in my application:
> controller name: streams_controller
> model name: stream
> and i want to validates a text field in the view  "new.html.erb".here
> tis field take a file to be uploaded
>
> i have a text field called :location in new.html.erb view
> to validate this field i have wriiten code in model like:
>
> class Stream < ActiveRecord::Base
> validates_presence_of :location
> .....
> ...
> ...
> end
>
> i did not see any validation.
> Can any one help where i am doing hte mistake.
>
> thanks
> Srikanth


Hi, please take a look at look at the following:

validates_presence_of<http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M002107>

Good luck,

-Conrad

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to