Thursday, October 30, 2008

remote_form_for with no-ajax support


<% form_remote_tag :url => {:controller => \'/posts\', :action => \'view\'},
:html => {:action => {:controller => \'/posts\', :action => \'view\', :id => @id}} do %>
<%= submit_tag \'View\' -%>
<% end %>


<form action=\"/posts/view/1\" method=\"post\"
onsubmit=\"new Ajax.Request(\'/posts/view/1\',
{asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\">
<input type=\"submit\" value=\"View\" />
</form>

No comments:

Post a Comment

Tell me what you think