Wednesday, October 24, 2012

Re: [Rails] validation check



On Wed, Oct 24, 2012 at 3:01 PM, Werner <webagentur.laude@googlemail.com> wrote:
Hi..
I have a select which I want to validate if a value is selected, otherwise not.

<%= f.collection_select :parent_id, Project.mainprojects.active, :id, :project_name, :include_blank => 'Partproject?', :allow_nil => true%>


so the name of the input is SOMETHING[parent_id]  right?
then you have to validate

if self.parent_id.blank?

Javier

--
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 https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate