search for: discount_rate

Displaying 3 results from an estimated 3 matches for "discount_rate".

2006 Mar 08
2
"humanizing" model attributes presentation
Given a field in database defined as "discount_rate numeric(3,1)" I found it not very usable for presenting it directly. For example, if there''s a value 5.00 it will render in <%= text_field ''model'', ''discount_rate %> as "0.5E1" which is not very friendly to user. All I do is that I wri...
2006 Mar 09
1
[TIP] Making an intelligent form fields
...printf(''%.2f %%'', value) end end This is an object that takes either float or string (with possible % character in it) and viewed as string looks like "1.23 %". So I can easily create an intelligent "shadow" attribute for interaction: composed_of :i_discount_rate, :class_name => ''Percentage'', :mapping => %w(discount_rate value) Using i_discount_rate in form it makes value of discount_rate shown in text field pretty with % sign. But we cannot pass it to the model because in mass-assignment everything is just string...
2008 Feb 20
1
text_field_tag - different parameter name
Hi, I have one problem with validation I am creating e-shop and I have products. This view look like this: <% for product in @category.products %> <div class="produktyBox"> <%= product.title %><br /> Price: <br /> <div style="color:red; font-size:large; font-weight:bold; margin- bottom:5px"><%=