Ruby on Rails - observe_field help

Posted by miligraf on Stack Overflow See other posts from Stack Overflow or by miligraf
Published on 2010-06-02T07:34:54Z Indexed on 2010/06/02 8:03 UTC
Read the original article Hit count: 191

Filed under:

Trying to put in field "pagar" the calculated value of "precio" * 15% but I don't know why it is not working :S

<% form_for @libro, :html => { :multipart => true } do |f| %>
<%= f.label "Precio (si es venta):" %>
<%= f.text_field :precio %>
<%= observe_field :libro_precio, 
    :frequency => 0.25,
    :update => :libro_pagar,
    :with => 'value*0.15'
%>

<%= f.label "A pagar (si es venta):" %>
<%= f.text_field :pagar %>
<% end %>

© Stack Overflow or respective owner

Related posts about ruby-on-rails