Monday, April 29, 2013

Re: [Rails] Re: required field for one, optional for another

On 29 April 2013 01:03, Soichi Ishida <lists@ruby-forum.com> wrote:
>> Are you talking about making the display change automatically
>> immediately the user selects which sort of user he is?
>
> Not really.
> I was thinking that when users sign up, they are either one type or the
> other. So, the required fields need to be set accordingly. User model
> validations hopefully filter upon submitting.
>
>
>> If I recall correctly, some of the standard validation helpers will
>> take an "if" parameter, such that if the parameter evaluates to false,
>
> Seems great. I will search for it.

Have a look at the Rails Guide on ActiveRecord Validations and
Callbacks. Also check out the other guides.

Colin

>
> soichi
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate