Re: [Rails] Re: Adding custom message on model validation in rails 3

2010-09-23 Thread Maksim Gudovsikov
Hi, it's the default error_message_on behavior. You can try to override it. Another solution could be to write your message without the attribute: just "can't be blank.", so you get "Name can't be blank". Hope it helps you. Regards, Maksim. Am 23.09.2010 12:09, schrieb Mike Disuza: > Hi, > Your

Re: [Rails] Re: Adding custom message on model validation in rails 3

2010-09-23 Thread Colin Law
On 23 September 2010 11:09, Mike Disuza wrote: > Hi, > Your solution is working but the message is coming like this:- What solution, from whom? You did not quote the previous message so no-one knows what you are talking about. Colin > > "Name Post name can't be blank." > > My model post.rb is:

[Rails] Re: Adding custom message on model validation in rails 3

2010-09-23 Thread Mike Disuza
Hi, Your solution is working but the message is coming like this:- "Name Post name can't be blank." My model post.rb is:- class Post < ActiveRecord::Base validates :name , :presence => { :message=>"Post name can't be blank."} validates :title, :presence => true, :length => { :minimum =>

[Rails] Re: Adding custom message on model validation in rails 3

2010-09-20 Thread Marnen Laibow-Koser
Please quote when replying. Edmond Kachale wrote: > I think differently: Why can't you use JavaScript to check for a blank > field? No way! JavaScript validations should never be relied on -- it's too easy for the client to turn them off and bypass them, or to submit a crafted GET or POST requ

[Rails] Re: Adding custom message on model validation in rails 3

2010-09-20 Thread Mike Disuza
Hey, I don't want to use the javascript, as rails directly provides us validations then why should we write code. Is there anyone know how to add custom message on model validation in rails 3.0.0 Thanks, Mike. -- Posted via http://www.ruby-forum.com/. -- You received this message because you