Here is the validation being used which is not working..

validates_presence_of :name => :controller_name, :if => :redirect?,
:message => "must have the same name as the controller."

The model has a string field for name.
The model has a boolean field for redirect.
The model has a string field for controller_name.

What I want to do is ensure that if the redirect box is checked for
true, that the name field matches the controller_name field precisely.

I'm not sure if validates_presence_of will do it.  I may have to create
a custom validation but am unsure how to proceed.

Much appreciation in advance...

Thanks.
-- 
Posted via http://www.ruby-forum.com/.
-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to