Re: [Rails] How to use validates?

2011-01-28 Thread Bente Pieck
On 28/01/11 15:54, Paul Bergstrom wrote: I can't get this to work. class User< ActiveRecord::Base validates :firstname, :presence => true, :message => "First name is missing" end And no error message. Why? PS: have you defined to show error_messages in your view? http://railscasts.com/ep

Re: [Rails] How to use validates?

2011-01-28 Thread Bente Pieck
On 28/01/11 15:54, Paul Bergstrom wrote: I can't get this to work. class User< ActiveRecord::Base validates :firstname, :presence => true, :message => "First name is missing" end And no error message. Why? Did you mean: validates :firstname, :presence => {:message => "First name is miss

Re: [Rails] How to use validates?

2011-01-28 Thread Walter Lee Davis
On Jan 28, 2011, at 9:54 AM, Paul Bergstrom wrote: I can't get this to work. class User < ActiveRecord::Base validates :firstname, :presence => true, :message => "First name is missing" end And no error message. Why? What do your views look like, either at the layout level or the users/

[Rails] How to use validates?

2011-01-28 Thread Paul Bergstrom
I can't get this to work. class User < ActiveRecord::Base validates :firstname, :presence => true, :message => "First name is missing" end And no error message. Why? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby