I’m new in rails 3. I’m using bootstrap and i want to display the validation errors next to the invalid field.
here is the code
<div class="control-group <%= @pet.errors.has_key?(:nick) ? "error": "" %>">
<%= f.label :nick, :class => 'control-label' %>
<div class="controls">
<%= f.text_field :nick, :class => 'text_field' %>
<% unless !@pet.errors.has_key?(:nick)%>
<span class="help-inline"><%= @pet.errors[:nick]%></span>
<%end%>
</div>
</div>
my problem is that <%= @pet.errors[:nick]%>returns
["no puede estar en blanco"]
and must be just
no puede estar en blanco
here you have an image
http://img848.imageshack.us/img848/8263/inlineerror.jpg
is there any way i can get the error message without the square brackets and the quotation marks?
Thanks in advance
You could try: