observe_form
- 1.0.0
- 1.1.6 (0)
- 1.2.6 (16)
- 2.0.3 (0)
- 2.1.0 (0)
- 2.2.1 (0)
- 2.3.8 (0)
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- What's this?
observe_form(form_id, options = {})
public
Like observe_field, but operates on an entire form identified by the DOM ID form_id. options are the same as observe_field, except the default value of the :with option evaluates to the serialized (request string) value of the form.
Multiple select and observe form
To make an observe form send all of the values selected in a multiple select html list, ensure you have the square brackets set in the name for the select tag e.g: group[]. This makes it pass the selected options in the params hash as an array.
<% remote_form_for :model, :url => {:action => ‘list’}, :html =>{:id => ‘model_id’} do |form| %>
<%= select_tag(‘group[]’, options_for_select(Model.find(:all).collect{|v|v.property}), :multiple => true) %>
<% end %>
<%= observe_form( ‘model’, :frequency => 2, :url => {:action => ‘list’} ) %>