I think differently: Why can't you use JavaScript to check for a blank
field?

Regards,

---
Edmond
Software Developer | Baobab Health Trust (http://www.baobabhealth.org/) |
Malawi

Cell:  +265 999 465 137 | +265 881 234 717

*"Many people doubt open source software and probably don’t realize that
there is an alternative… which is just as good.." -- Kevin Scannell*



2010/9/20 Mike Disuza <[email protected]>

> Hi,
> I am developing an application in rails 3.0
>
> I have post Model
> class Post < ActiveRecord::Base
>  validates :name ,  :presence => true
> end
>
> I have added the presence of validation on post name.
> It shows me error that "Name can't be blank"
>
> I have to give the custom message for the user so I have written like as
> follows:-
>
> class Post < ActiveRecord::Base
>  validates :name ,  :presence => true , :message=>"Post name can't be
> blank."
> end
>
> But it is giving me error:-
> "Unknown validator: 'message'"
>
> Can anyone tell me How to give the custom message in rails 3 model
> validations?
>
> Thanks,
> Mike
> --
> 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]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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