RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: trevorgrayson
Site: http://trevorgrayson.com
scratch that. :-$
is it just me, or does the question mark on the function name break this?
This works for me: validates_presence_of :state, :if => :in_us def in_us country == 'US' end
This, would not: validates_presence_of :state, :if => :in_us? def in_us? country == 'US' end
scratch that. :-$
is it just me, or does the question mark on the function name break this?
This works for me:
validates_presence_of :state, :if => :in_us
def in_us
country == 'US'
end
This, would not:
validates_presence_of :state, :if => :in_us?
def in_us?
country == 'US'
end