I need to use in_place_checkbox. I have tried the inplacecontrols plugin, but it is not working. Here is my code (some of it is dutch, in case you're wondering):
<h1>Verwerken rekeningen</h1> <%= start_form_tag({:action => "get_invoices"}, :id => "entry-form") %> <p><label for="invoice_month">Maand</label><br/> <%= select_year(Date.today, :start_year => Schoolyear.get_startdate.year, :end_year => Schoolyear.get_enddate.year)%> <%= select_month(Date.today)%></p>
<p><label for="parent_payment"><%= Parent.human_attribute_name("payment")%></label><br/> <%= select(:parent, :payment, %w{ 6 2 1}) %></p> <%= end_form_tag %>
<%= observe_form "entry-form", :frequency => 0.5, :update => "live-preview", :url => { :action => "get_invoices" } %>
<div id="live-preview"></div>
That calls get_invoices (notice the observe_form part):
<% if @invoices.empty? %> <p>Geen rekeningen gevonden. Selecteer een andere groep of maand.</p> <% else %> <table> <tr> <th>Naam</th> <th>Betaald</th> </tr> <% @invoices.each do |invoice| %> <% next if invoice.total_amount == 0 %> <% @invoice = invoice %> <tr> <td><%= invoice.parent.fullname %></td> <td><%= in_place_checkbox(:invoice, :paid, :checked => true, :unchecked => false) %></td> </tr> <% end %> </table> <% end %>
A checkbox is shown in the view, but it is not working.
Does anybody knows what is wrong? Or does anybody have a solution that is actually working?