Monday, August 2, 2010

[Rails] Re: radio box validation

Dis Tec wrote:
> I have created some radio boxes as follows:
>
> <% f.radio_button :usertype, "false" %>False
> <% f.radio_button :usertype, "true" %>True
>
> where usertpe is a boolean in the db
>
> I want to be able to create a default selection and I want to validate
> the options and ensure that for whatever reason there is always a check
> in one of the boxes...now I know a proper radio box config will always
> have one option selected. How do I validate? For example
> validates_prescence_of: usertype?

Any ideas how to do this?

--
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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate