I'm using rails form helper to generate form and retrieve data from users. like this
<div class="controls">
<%= f.text_field :duration, class: "input-large" %>
</div>
however,I need this input, before its store to database 'duration' column,multiply by 10. I have search about this and try implement a method,create a function,which multiply the value,and call it under before_save
before_save :multiply_ten, on: [ :create,:update ]
problem is,i'm not only updating this column using web page form,and also by http request send by device.by implementing this I multiply all value by 10,But I only want the web form input part multiply 10. is there a way to do it in form css or have other tricks? thanks