hello my name is reynaldo
and i have a problem
i alter the _form.rhtml to display a select option in the place a simple
text_box, and the application work very well, but in the moment that i
apply a validation in the model i get a error.
the code is the next
in the controller:
def new
@catelemento = Catelemento.new
@komandancias = Catcomandancia.find(:all)
end
in the _form.rhtml
<%= error_messages_for ‘catelemento’ %>
Comandancia
<%for koman in @komandancias %>
<%= koman.Nombre %>
<% end %>
Clave
<%= text_field 'catelemento', 'Clave' %>
Nombre
<%= text_field 'catelemento', 'Nombre' %>
in the model
class Catelemento < ActiveRecord::Base
validates_presence_of :Nombre
end
the case is the next:
if i remove the validation : the application works
if i remove the selecet option : the application works
but i need both characteristics
if any person can help me, i’ll thank you so much