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
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
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 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
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 %>
>
>
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
>
>
>
> 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' %
7 matches
Mail list logo