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?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---