flukus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Mar-05 08:57 UTC
select tag and fieldWithErrors
I''ve been trying to work out the rails way of handling this. I have my form which contains: <%= select(:user, :state_id, @states) %> The only problem is that the fieldWithErrors div won''t get added if nothing is selected. If I change it too: <%= select(:user, :state, @states) %> I get the error: State expected, got String Does rails have a graceful way of doing this? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hi! please have a look at my blog post, as i described the problem and a solution there: http://blog.invalidobject.com/2007/09/16/rails-error-wrapping-for-select-input-fields-of-referenced-models/ regards, frank flukus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> I''ve been trying to work out the rails way of handling this. I have my > form which contains: > > <%= select(:user, :state_id, @states) %> > > The only problem is that the fieldWithErrors div won''t get added if > nothing is selected. > > If I change it too: > > <%= select(:user, :state, @states) %> > > I get the error: > > State expected, got String > > Does rails have a graceful way of doing this?-- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---