I don't think the problem here is with Haml. Are you doing a
render :update in that ajax_login action you're hitting? It looks
like you are. Because you shouldn't combine that with the :update
parameter to form_remote_tag. You need one or the other. The :update
parameter causes the entire response to be shoved into the target div,
where as render :update returns javascript that you expect to execute
to do whatever, like updating the div. Very different. It really
looks like you returned an RJS response and shoved it into that
documentContent div.
-Tom
On Jun 6, 12:47 am, walther curly_a diechmann punta net <[EMAIL PROTECTED]>
wrote:
> Soddier than ever (now with nothing to show for it, but a button)
>
> <div id="documentcontent">
> <form action="/account/ajax_login" method="post" onsubmit="new
> Ajax.Updater({success:'documentcontent'}, '/account/ajax_login',
> {asynchronous:true, evalScripts:true,
> parameters:Form.serialize(this)}); return false;">
> <button style="width: 100px;" type="submit">Login</button>
> </form>
>
> </div>
>
> the _login.haml now is made up of
>
> - form_remote_tag( :update=> {:success => 'documentcontent'}, |
> :url => { :controller => 'account', |
> :action => 'ajax_login' }) do
>
> %button{ :type=>"submit", :style=>"width: 100px;"} Login
>
> and when I press the 'submit' button - my documentcontent div fills up
> with the same kind of c... <:)
>
> <div id="documentcontent">try {
> Element.update("documentcontent", "<form action="\"/account/
> ajax_login\"" method="\"post\"" onsubmit='\"new'
> ajax.updater({success:="" documentcontent="" },="" account=""
> ajax_login="" ,="" {asynchronous:true,="" evalscripts:true,=""
> parameters:form.serialize(this)});="" return="" false;\="">\n <button
> style="width: 100px;" type="submit">Login</button>\n</form>\n");} catch (e) {
> alert('RJS error:\n\n' + e.toString());
>
> alert('Element.update(\"documentcontent\", \"<form action="\\\"/
> account/ajax_login\\\"" method="\\\"post\\\""
> onsubmit='\\\"new' ajax.updater({success:\="" documentcontent
> \="" },="" \="" account="" ajax_login\="" ,="" {asynchronous:true,=""
> evalscripts:true,="" parameters:form.serialize(this)});="" return=""
> false;\\\="">\\n <button style="" 100px;\="" type="\'submit\'">Login</
> button>\\n</form>\\n\");'); throw e }</div>
>
> On Jun 5, 7:13 pm, Nathan Weizenbaum <[EMAIL PROTECTED]> wrote:
>
> > Can you work this down to a minimal case (both in terms of Haml and Ruby
> > code) that still exhibits this behavior?
>
> > - Nathan
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---