I have a column :sex in the user table which is a text field in the database.
And a formtastic form that renders it as
<%= form.input :sex, :as => :radio, :label => 'Title', :collection => [["Mr.", 'male'], ["Mrs.", 'female']], :required => true %>
When I add "validates_presence_of :sex" to the model then all client-side validation fails. OnLoad of the html a javascript error occurs. Firebug says the following (I don't know if that helps):
this.__elements[0] is undefined
http://localhost:3000/javascripts/v2.standalone.full.min.js?1259591608
G()()v2.stand...259591608 (Linie 7)
G()()v2.stand...259591608 (Linie 7)
G()()v2.stand...259591608 (Linie 7)
G()(Object __events=[2] __elements=[0] __monitored=true, Object __name=presence __message=can't be blank, [], undefined)v2.stand...259591608 (Linie 7)
G()()v2.stand...259591608 (Linie 7)
G()(Object __name=presence __message=can't be blank, [], undefined)v2.stand...259591608 (Linie 7)
G()([Object validator=Object params=[0] invert=false 0=Object], Object __validators=[0] __errors=[0] __passOnAny=false, "")v2.stand...259591608 (Linie 7)
G()(form#user_form.validate users, Object __validators=[0] __errors=[0] __passOnAny=false, [])v2.stand...259591608 (Linie 7)
G()(form#user_form.validate users)v2.stand...259591608 (Linie 7)
G()()v2.stand...259591608 (Linie 7)
G()()v2.stand...259591608 (Linie 7)
G()()v2.stand...259591608 (Linie 7)
[Break on this error] var addDOMLoadEvent=(function(){var F=[]...getElementsByTagName("input")[0]:A)}}});
I have a column :sex in the user table which is a text field in the database.
And a formtastic form that renders it as
<%= form.input :sex, :as => :radio, :label => 'Title', :collection => [["Mr.", 'male'], ["Mrs.", 'female']], :required => true %>
When I add "validates_presence_of :sex" to the model then all client-side validation fails. OnLoad of the html a javascript error occurs. Firebug says the following (I don't know if that helps):
this.__elements[0] is undefined
http://localhost:3000/javascripts/v2.standalone.full.min.js?1259591608
G()()v2.stand...259591608 (Linie 7)
G()()v2.stand...259591608 (Linie 7)
G()()v2.stand...259591608 (Linie 7)
G()(Object __events=[2] __elements=[0] __monitored=true, Object __name=presence __message=can't be blank, [], undefined)v2.stand...259591608 (Linie 7)
G()()v2.stand...259591608 (Linie 7)
G()(Object __name=presence __message=can't be blank, [], undefined)v2.stand...259591608 (Linie 7)
G()([Object validator=Object params=[0] invert=false 0=Object], Object __validators=[0] __errors=[0] __passOnAny=false, "")v2.stand...259591608 (Linie 7)
G()(form#user_form.validate users, Object __validators=[0] __errors=[0] __passOnAny=false, [])v2.stand...259591608 (Linie 7)
G()(form#user_form.validate users)v2.stand...259591608 (Linie 7)
G()()v2.stand...259591608 (Linie 7)
G()()v2.stand...259591608 (Linie 7)
G()()v2.stand...259591608 (Linie 7)
[Break on this error] var addDOMLoadEvent=(function(){var F=[]...getElementsByTagName("input")[0]:A)}}});