Hey, as you all may know error_messages are deprecated: DEPRECATION WARNING: f.error_messages was removed from Rails and is now available as a plugin. Please install it with `rails plugin install git://github.com/rails/dynamic_form.git` Installing the plugin of course helps but I''ve been googling a bit and stuff but couldn''t find the proper new Rails 3 way of handling the error messages. Can someone please tell me how to do it without that plugin? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 17 September 2010 11:54, Heinz Strunk <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> as you all may know error_messages are deprecated: > DEPRECATION WARNING: f.error_messages was removed from Rails and is now > available as a plugin. Please install it with `rails plugin install > git://github.com/rails/dynamic_form.git` > > Installing the plugin of course helps but I''ve been googling a bit and > stuff but couldn''t find the proper new Rails 3 way of handling the error > messages. Can someone please tell me how to do it without that plugin?I believe the idea is that you can write your own helper method to format the errors exactly how you want them. You can access the error messages directly by using the #errors method on the Active Record object; for example: person.errors.full_messages Documentation for that is here: http://api.rubyonrails.org/classes/ActiveModel/Errors.html The source for the error_messages_for method in the dynamic_form plugin might also be a source of ideas: http://github.com/rails/dynamic_form/blob/master/lib/action_view/helpers/dynamic_form.rb#L183 Chris -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Alright, thanks! Will build my own helper method then. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ok, guys, we can write our own helper.... but why, when it is ready? Start (with Rails 3) a new project and scaffold a dummy resource. Then, copy the error handling from the _form partial thus generated and adapt it to your needs. It think it is the best way to learn how to code as an insider, provided scaffolding is maintained by insiders. HTH better -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
What do you mean by "when it is ready?" It is kinda ready :) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I meant "if it is already done"... and I meant "previously, by someone else", but, ok, two months is time enough for some hundreds of helpers :) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.