[Rails] Re: error_messages_for help

2009-09-04 Thread Matt Jones
If you're returning RJS or the like from the AJAX call, the method I'd use would be to wrap the error_messages_for in a div and send back a page.replace call that fills it out. I've used this in a couple production apps without problems. --Matt Jones On Aug 29, 4:51 am, bgumbiker wrote: > Hello

[Rails] Re: error_messages_for help

2009-09-03 Thread bgumbiker
Thanks for all suggestion. It seems that the only solution is the javascript. bogumbiker On Aug 31, 8:21 pm, Frederick Cheung wrote: > On Aug 30, 4:29 am, bgumbiker wrote: > > > No success. Any other ideas? > > thanks > > You need to write some javascript/rjs to (after form submission) > render

[Rails] Re: error_messages_for help

2009-08-31 Thread Frederick Cheung
On Aug 30, 4:29 am, bgumbiker wrote: > No success. Any other ideas? > thanks You need to write some javascript/rjs to (after form submission) render a partial (which displays errors in whatever way you want) and insert that into the appropriate part of the DOM Fred --~--~-~--~~-

[Rails] Re: error_messages_for help

2009-08-30 Thread Ghanshyam Rathod
Rails List wrote: > >> >> The <%= error_messages_for 'quotation' %> is always replaced by empty >> space in html as 'quotation' at that time is nil. >> >> Any idea how to make it work without setting 'quotation' variable in >> the controller? >> >> thanks, >> bogumbiker > Try this <%= erro

[Rails] Re: error_messages_for help

2009-08-30 Thread Colin Law
2009/8/29 bgumbiker : > > Hello, > Does anyone know how to use error_messages_for with remote_form_for? > > Here is my code: > > <%= error_messages_for 'quotation' %> > > >  <% remote_form_for(Quotation.new, :url => { :action => > "send_quotation" }) do |f| %> > > > > <% end %> > >

[Rails] Re: error_messages_for help

2009-08-29 Thread bgumbiker
On Aug 29, 7:00 pm, Rails List wrote: > > The   <%= error_messages_for 'quotation' %> is always replaced by empty > > space in html as 'quotation' at that time is nil. > > > Any idea how to make it work without setting 'quotation' variable in > > the controller? > > > thanks, > > bogumbiker > >

[Rails] Re: error_messages_for help

2009-08-29 Thread Rails List
> > The <%= error_messages_for 'quotation' %> is always replaced by empty > space in html as 'quotation' at that time is nil. > > Any idea how to make it work without setting 'quotation' variable in > the controller? > > thanks, > bogumbiker try placing <%= error_messages_for 'quotation' %