search for: format_of

Displaying 3 results from an estimated 3 matches for "format_of".

2007 May 05
10
have_one and have_present
...e more Rails-developer-friendly than customer-friendly, but it still ''speaks'' better than ''have_present'' for me. FYI - Jay Fields has a Validatable framework that includes some test/unit assertions that look like this: Foo.must_validate do presence_of :name format_of(:name).with(/^[A-Z]/) numericality_of(:age).only_integer(true) end Because Spec::Rails behaviours inherit from Test::Unit::TestCase, you can install the validations gem (gem install validatable) and use these as/is with RSpec. Or, if you want it to feel more spec''ish, you could monkey...
2006 Jun 23
0
utf8 and error messages
Hi, I was wondering how to access the messages that are generated from the validation methods in rails (validates_presence_of, format_of, maxlength, etc) I need to change them to a different language (encoding type utf8) and render them to my view without the messages that are generated automatically from the validation methods - - so that in the end I can bring the "error_messages_for_blahblah" and it will bring my utf-...
2012 Aug 14
3
validates_format_of :message not working, validates_length_of :message is working
I''m using validates_format_of and the validation I want to do works, but I can''t get an error message to be displayed if the data is invalid: validates_format_of :mobile, :with => /\A[\+0-9]+\Z/, :message => " - Wrong" I have another validation some where else that does display the error message: &qu...