Re: [Rails] Validation problem

2010-08-08 Thread Hassan Schroeder
On Sun, Aug 8, 2010 at 4:18 PM, RichardOnRails wrote: > I've got an Expense model as follows: > > class Expense < ActiveRecord::Base >  belongs_to :vendor > >  def validate_on_create >    unless params["expense"]["vendor_id"] != "0"   # <= Line 5 ?? At that point your instance of Expense should

[Rails] Validation problem

2010-08-08 Thread RichardOnRails
Hi All, I've got an Expense model as follows: class Expense < ActiveRecord::Base belongs_to :vendor def validate_on_create unless params["expense"]["vendor_id"] != "0" # <= Line 5 errors.add("A vendor must be selected before creating the expense record") end end end that c

[Rails] validation problem

2009-08-20 Thread Wap Addon
Hello Guys i want to use external validation i mean javascript validation but whenever click on create i mean (add new record submit)that time my first text box is black then it give me alert but when i click on 'ok' it redirect to controller and give error not focus on same text box. -- Posted v

[Rails] Validation Problem

2008-12-30 Thread emarthinsen
Hello- I'm trying to do something pretty basic - validate a form field against a regex. Here's the line of my model that adds the validation: validates_format_of :zipcode, :with => /\d{5}(-\d{4})?/, :message => 'is failing the regex' When I enter the value "12345" into the form field, it comes

[Rails] validation problem

2008-09-17 Thread Sam Ginko
I'm having issues with the validation process. Some of it works fine and others don't and I do not know why. in this case the last 3 validations below do not work at all. I'm I doing something wrong? this should be pretty straight forward, so I thought. validates_presence_of :login, :email v