Is it possible to print error message near the inputbox and not all on top of the page by <%= error_messages_for ''users'' %> So if I have user registragion form and there ara inputs: username password password_confirm email And if there some errors its prits errors near the input boxes: username: [_________] Username should be (2 to 20 characters) password: [_________] password confirmation: [_________] Password did not match email [____________] -- 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 -~----------~----~----~----~------~----~------~--~---
On Feb 21, 4:23 pm, Jo Jo <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Is it possible to print error message near the inputbox and not all on > top of the page by <%= error_messages_for ''users'' %> >Yes and no. error_messages_for won''t do it, but you have to realise that error_messages_for is just a way of doing errors, this nothing wrong with rolling your own thing (there''s very little code in error_messages_for). You might be interested in error_message_on which gets you the error messages for a single attribute. Fred> So if I have user registragion form and there ara inputs: > > username > password > password_confirm > email > > And if there some errors its prits errors near the input boxes: > > username: [_________] Username should be (2 to 20 characters) > password: [_________] > password confirmation: [_________] Password did not match > email [____________] > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You''ll need to use f.error_messages and the form builder: http://ramblingsonrails.com/how-to-make-a-custom-form-builder-in-rails Ramon Tayag On Sun, Feb 22, 2009 at 12:23 AM, Jo Jo <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Is it possible to print error message near the inputbox and not all on > top of the page by <%= error_messages_for ''users'' %> > > So if I have user registragion form and there ara inputs: > > username > password > password_confirm > email > > And if there some errors its prits errors near the input boxes: > > username: [_________] Username should be (2 to 20 characters) > password: [_________] > password confirmation: [_________] Password did not match > email [____________] > -- > 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 -~----------~----~----~----~------~----~------~--~---