I have a account_controller.rb with

def login
....
     else
          flash[:error] = "False username/password - try again, please!"
          render :partial => 'login'
     end
end

I have a _login.haml with
.....
    - form_remote_tag( :update=> {:success => 'documentcontent'}, :url
=> { :controller => 'account', :action => 'login' }) do
      %table
.....

....
            = if flash[:error]
              %span.error-message
                flash[:error]
....

If I comment out the flash[.error] in my account_controller.rb
everything plays nice (ie my documentcontent div gets filled with the
output from _login.haml) - but if I leave the flash[:error] in there,
the update fills the span.error-message with not only the
flash[:error], but the entire output from _login.haml!!

I know I'm supposed to do this in some other fashion, but endless
tests unfortunately have not revealed this to me :(

My question is:

If I like to do a render partial on a form_remote_tag, how can I refer
to the flash[:error] - and it is not outside the div being updated, it
is inside like in this example

<div id="to be updated by Ajax.Updater">
     <!-- result from render :partial=>'action' -->
     conditional span with flash[:error]
</div>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to