Home
> Rails Reference > Rails and observe_form
Rails and observe_form
In using the method observe_form in Rails, your form should be created with the option :id. Otherwise, the observe_form won’t be able to locate the form and javascript error is encountered in prototype.js.
Sample code snippet in the rhtml:
<% form_tag(‘javascript:void(0)’, :id => ‘my_form’) do %>
…
<% end %>
<%= observe_form :my_form,
: url => {:action => ‘new’} %>
Categories: Rails Reference
Comments (0)
Trackbacks (0)
Leave a comment
Trackback